On 11/19/2011 04:57 AM, Xose Vazquez Perez wrote:
> Kevin Kofler wrote:
>
>> Indeed, -Wall is not really all. :-) -Wall -Wextra is closer to all, but
>> there are still some things those won't warn about, e.g. -Wwrite-strings
>> catches places which use a string literal as a potentially writable char *
>> instead of a const char *.
>
> -O2 is required by -Warray-bounds.
>
> ALL C code should be compiled with -O2 -Wall -W(aka -Wextra). And _maybe_
> also with -std=xxxx and -pedantic, + splint + valgrind ...

... you'd get lost, because many of the warnings
- aggressive -W flags trigger are false/bogus [1]
- aggressive -W flags trigger are GCC stylishness and are no real bugs.
- "-std=..." is not helpful for bug-chasing.

Keep in mind, warnings are _hints_ ... they point at spots into the 
code, GCC believes something could be wrong, but they do not necessarily 
means something actually is wrong.

If GCC is sure something is wrong, it is supposed to raise errors.

Ralf

[1] -Wstrict-aliasing is one of these cases.
The spots such warnings point to, often are broken, but not always, 
because GCC has difficulties in identifying these.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reply via email to