-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: suppress coverity message #7587
Conversation
LGTM |
@@ -209,6 +209,8 @@ inline MUST_USE_RESULT bool ParseArrayIndex(Local<Value> arg, | |||
|
|||
// Check that the result fits in a size_t. | |||
const uint64_t kSizeMax = static_cast<uint64_t>(static_cast<size_t>(-1)); | |||
// Tell coverity that this is not a constant expression on all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a constant expression, however. I'd just leave out the comment, it's clear enough from context that we're trying to shut up coverity.
LGTM with or without the comment |
LGTM |
Coverity marked a change in 630096b as a constant expression. However, on platforms where sizeof(int64_t) > sizeof(size_t), this should not be the case. This commit flags the comparison as OK to coverity. PR-URL: nodejs#7587 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed in 18ae74c without the extra comment. |
@cjihrig lts? |
Yes please. |
@cjihrig this does not land cleanly and will require a manual backport if you are up for it |
This should apply cleanly once #7497 is backported. If that's not the case, let me know. |
Coverity marked a change in 630096b as a constant expression. However, on platforms where sizeof(int64_t) > sizeof(size_t), this should not be the case. This commit flags the comparison as OK to coverity. PR-URL: #7587 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Coverity marked a change in 630096b as a constant expression. However, on platforms where sizeof(int64_t) > sizeof(size_t), this should not be the case. This commit flags the comparison as OK to coverity. PR-URL: nodejs#7587 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Coverity marked a change in 630096b as a constant expression. However, on platforms where sizeof(int64_t) > sizeof(size_t), this should not be the case. This commit flags the comparison as OK to coverity. PR-URL: #7587 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Coverity marked a change in 630096b as a constant expression. However, on platforms where sizeof(int64_t) > sizeof(size_t), this should not be the case. This commit flags the comparison as OK to coverity. PR-URL: #7587 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
src
Description of change
Coverity marked a change in 630096b as a constant expression. However, on platforms where
sizeof(int64_t) > sizeof(size_t)
, this should not be the case. This commit flags the comparisonas OK to coverity.
Disclaimer: I have no idea how to test this with coverity. I put this together based on existing code in core and some Googling.
R= @bnoordhuis