-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix #11685: FP floatConversionOverflow from dead code #6973
Conversation
test/testtype.cpp
Outdated
@@ -495,6 +495,46 @@ class TestType : public TestFixture { | |||
" return 1234.5;\n" | |||
"}", settingsDefault); | |||
ASSERT_EQUALS("[test.cpp:2]: (error) Undefined behaviour: float () to integer conversion overflow.\n", removeFloat(errout_str())); | |||
|
|||
const Settings settingsWithStdint = settingsBuilder().library("std.cfg").build(); |
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.
I don't think loading std.cfg is required. Can you cast to "unsigned short" instead of uint16_t? That should save some cpu cycles.
lib/astutils.cpp
Outdated
break; | ||
|
||
if (parent->isBinaryOp()) { | ||
bool left = tok == parent->astOperand1(); |
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.
nit: make left const.
No description provided.