-
Notifications
You must be signed in to change notification settings - Fork 0
Add further warnings #11
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
Conversation
816dfba to
784b8e8
Compare
Dudeldu
left a comment
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 really like the warning showing exactly where you lost the "exactness".
| int check2 = (x == y); // WARN | ||
|
|
||
| // The following is __DBL_MAX__ | ||
| double my_max = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000; |
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.
Add the header float.h, so you can use DBL_MAX instead of this interesting number
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 guess this is the same issue i had with DBL_MIN ? #13 (comment)
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.
Right, I also added the DBL_MAX case to my fix
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.
With #10 merged, we should now be able to use DBL_MAX constant.
acf0cd3 to
2318f94
Compare
|
Why are the regression tests still failing? Seems like there is no warning generated for the first comparison. |
…but are not exact anymore after
…dd warning for not equal
2318f94 to
ea0b433
Compare
First is CWE 1077
For the second point I have found these that fit: