Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
chandlerc
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
chandlerc
15y ago
Most of the cases we ran into were metaprogramming techniques which test whether an expression is a valid null pointer constants. These got innocently applied to 'false' and trigger the warning needlessly.
2.
▲
by
chandlerc
15y ago
GCC definitely has a warning for 0.5 -> int (likely -Wconversion, but I've not checked). It also has a warning for setting a pointer to "false" (-Wconversion-null). However, turning that warning on in a codebase where every warning brea
3.
▲
by
chandlerc
15y ago
That's the whole point. =] This is a surprising aspect of C++: the shift expression doesn't have the type of the declared variable. The integer literals we are shifting are of 'int' type, and the shift occurs at that type (based on the usua
4.
▲
by
chandlerc
15y ago
Doh! Good catch, comment updated. =[ Maybe we do need Clang-for-comments as well as Clang-for-C++ code.... ;]
5.
▲
by
chandlerc
15y ago
I would expect many of these tools to catch these types of bugs. The challenging thing for us has been to catch only bugs, and to catch them very fast during normal compilation. A lot of the static analyses we've looked into (and I'm hopi