Skip to content

Node 8: Compiler warning about invalid format passed to fprintf when building in VS 2015 #13463

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
KobyBo opened this issue Jun 5, 2017 · 1 comment · Fixed by #13447
Closed
Labels
async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. confirmed-bug Issues with confirmed bugs.

Comments

@KobyBo
Copy link

KobyBo commented Jun 5, 2017

  • Version: 8.0.0
  • Platform: Visual Studio 2015 (Update 3) on Windows 10
  • Subsystem: Win32 (x86)
  • Using the sln and vcxproj files generated by running "vcbuild.bat x86 release".

Hi
While compiling node v8 (using sources downloaded yesterday) on VS 2015 (Update 3), I've noticed I'm receiving the following compiler warnings:

warning C4476: 'fprintf' : unknown type field character ''' in format specifier
warning C4474: 'fprintf' : too many arguments passed for format string

about the following line in env-inl.h (got the warnings repeatedly, for each cpp which includes env-inl.h):

inline bool Environment::AsyncHooks::pop_ids(double async_id) {
...
    fprintf(stderr,
              "Error: async hook stack has become corrupted ("
              "actual: %'.f, expected: %'.f)\n",
               uid_fields_[kCurrentAsyncId],
               async_id);
..,

The "%'.f" format doesn't seem right (or I'm missing something).

@AndreasMadsen
Copy link
Member

Thanks for the report.

It is only supported by some compilers, we are fixing it in #13447

@AndreasMadsen AndreasMadsen added async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. confirmed-bug Issues with confirmed bugs. labels Jun 5, 2017
@refack refack self-assigned this Jun 5, 2017
refack added a commit to refack/node that referenced this issue Jun 6, 2017
It is not supported on Windows so it emits:
warning C4476: 'fprintf' :
  unknown type field character ''' in format specifier
warning C4474: 'fprintf' :
  too many arguments passed for format string

PR-URL: nodejs#13447
Fixes: nodejs#13463
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
jasnell pushed a commit that referenced this issue Jun 7, 2017
It is not supported on Windows so it emits:
warning C4476: 'fprintf' :
  unknown type field character ''' in format specifier
warning C4474: 'fprintf' :
  too many arguments passed for format string

PR-URL: #13447
Fixes: #13463
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@refack refack removed their assignment Oct 24, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. confirmed-bug Issues with confirmed bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants