4 ms·
Somewhat off-topic, but to defend gcc against clang, here is a modern version of gcc with the correct warning option: $ gcc-4.8 -std=gnu99 -Wall -o test te
by comex 13y ago
Somewhat off-topic, but to defend gcc against clang, here is a modern version of gcc with the correct warning option:
$ gcc-4.8 -std=gnu99 -Wall -o test test.c
test.c: In function 'main':
test.c:6:5: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if (foo & 0x80 == 0x80) {
^
gcc 4.9 will have colored diagnostics, too.
Cool project, though.
- nitrogen 13y agoThis would be a great way, on a compiler or project that doesn't have this warning enabled, to conceal a deliberate bug and have it appear to be accidental.
- dietrichepp 13y agoHey, check out the Underhanded C Contest. http://underhanded.xcott.com http://underhanded.xcott.com
- pjscott 13y agoThe rivalry between gcc and clang has been wonderful for everybody who use either of them.
- nullc 13y agoSome of these warnings start delving a bit too close to "Warning: Competent C programmer detected", ... too eager to flag "less common" usage like the dreaded 'original definition of the insertion operator' rather than specifically targeting things that are genuinely suspicious.