dtrace: resolve conversion warning (Windows) #10143

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@brodybits
Contributor
Checklist
  • make -j8 test (UNIX [macOS]; Linux i386 & amd64) and vcbuild test nosign (.\vcbuild.bat nosign then .\vcbuild.bat test nosign nobuild as Administrator on Windows) PASS OK
  • commit message follows commit guidelines
Additional item
Affected core subsystem(s)

dtrace

Description of change

static_cast<int32_t> in SLURP_INT macro - resolve conversion warning on Windows

NOTE: This was originally a part of PR #10139 (build, warning, header, and include fixes).

ADDITIONAL NOTE: This and some warnings related to PR #10139 may indicate potential data loss scenarios. For future examination.

src/node_dtrace.cc
- ->ToInteger(env->isolate())->Value();
+ *valp = \
+ static_cast<int32_t>(obj->Get(OneByteString(env->isolate(), #member)) \
+ ->ToInteger(env->isolate())->Value());
@bnoordhuis
bnoordhuis Dec 6, 2016 Member

obj->Get(...)->Int32Value()?

@brodybits
Contributor

@bnoordhuis I did redo the fix according to your suggestion, thanks for the feedback!

@bnoordhuis

LGTM but can you spruce up the commit log a little? I.e., more than just "(Windows)"?

CI: https://ci.nodejs.org/job/node-test-pull-request/5291/

@brodybits
Contributor

Yes the log could have been better. I wanted to put the "(Windows)" part on the subject line but then I couldn't fit a nice, complete commit subject into the standard 50 character length.

My idea is to replace "(Windows)" with "(Windows build)". Short, sweet, and to the point. @bnoordhuis please reply if this is still not quite good enough. Otherwise I will do this tomorrow morning.

@bnoordhuis
Member

Take a look at other commits for inspiration. It should consist of a short status line and a few more lines describing the what and why. I usually include the compiler message verbatim when it's a fix for a compiler warning.

@brodybits
Contributor

I just amended the commit with the following message:

dtrace: resolve conversion warnings from SLURP_INT

Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data
@brodybits brodybits dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data
5a8126c
@jasnell jasnell added a commit that referenced this pull request Dec 27, 2016
@brodybits @jasnell brodybits + jasnell dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data

PR-URL: #10143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
099762d
@jasnell
Member
jasnell commented Dec 27, 2016

Landed in 099762d

@jasnell jasnell closed this Dec 27, 2016
@joyeecheung joyeecheung added a commit to joyeecheung/node that referenced this pull request Jan 2, 2017
@brodybits @joyeecheung brodybits + joyeecheung dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data

PR-URL: nodejs#10143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
a7d2e4e
@evanlucas evanlucas added a commit that referenced this pull request Jan 3, 2017
@brodybits @evanlucas brodybits + evanlucas dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data

PR-URL: #10143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
be3bc62
@evanlucas evanlucas referenced this pull request Jan 3, 2017
Merged

v7.4.0 release proposal #10589

@evanlucas evanlucas added a commit that referenced this pull request Jan 3, 2017
@brodybits @evanlucas brodybits + evanlucas dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data

PR-URL: #10143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
872d090
@evanlucas evanlucas added a commit that referenced this pull request Jan 4, 2017
@brodybits @evanlucas brodybits + evanlucas dtrace: resolve conversion warnings from SLURP_INT
Resolve build warnings on Windows with the following pattern:
warning C4244: '=': conversion from 'int64_t' to 'int32_t',
possible loss of data

PR-URL: #10143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
f9a5c13
@MylesBorins
Member

Should this be backported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment