Skip to content

src: remove ' printf modifier#13447

Merged
refack merged 1 commit intonodejs:masterfrom
refack:simpler-printf
Jun 6, 2017
Merged

src: remove ' printf modifier#13447
refack merged 1 commit intonodejs:masterfrom
refack:simpler-printf

Conversation

@refack
Copy link
Copy Markdown
Contributor

@refack refack commented Jun 4, 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

Fixes: #13463

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jun 4, 2017
@refack refack added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jun 4, 2017
@refack refack self-assigned this Jun 4, 2017
@refack
Copy link
Copy Markdown
Contributor Author

refack commented Jun 4, 2017

@refack refack changed the title src: remove ' print modifier src: remove ' printf modifier Jun 4, 2017
@mscdex mscdex added the async_hooks Issues and PRs related to the async hooks subsystem. label Jun 4, 2017
Comment thread src/env-inl.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The . should not be removed. Otherwise we get ${id}.000000.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P.S. why is it a double?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it a double?

So that it isn’t limited by 2^32 in its range, but still representable in JS. If you prefer, casting to uint64_t should be safe here.

Copy link
Copy Markdown
Contributor Author

@refack refack Jun 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer, casting to uint64_t should be safe here.

I'll read a bit about fprintf on windows and think about it.
IMHO for this PR %.f works

@gibfahn
Copy link
Copy Markdown
Member

gibfahn commented Jun 5, 2017

Worth adding a

Fixes: https://github.com/nodejs/node/issues/13463

Copy link
Copy Markdown
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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>
@refack refack merged commit f06c05c into nodejs:master Jun 6, 2017
@refack
Copy link
Copy Markdown
Contributor Author

refack commented Jun 6, 2017

landed in f06c05c

@refack refack deleted the simpler-printf branch June 6, 2017 18:42
jasnell pushed a commit that referenced this pull request 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 Jun 12, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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++. lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

10 participants