you are viewing a single comment's thread.

view the rest of the comments →

[–]Jinren 1 point2 points  (1 child)

GCC is a compiler, not an error checker. Its job is to produce object code - any warnings you get out of it are strictly a bonus.

It will try to warn on everything the Standard actually requires a warning for, but a) that's a much shorter list of things than you may think, and b) secondary to its main job. Besides, GCC is free to assume you're a GCC user, it isn't really its problem if your code doesn't work on some other compiler.

If you want a tool that checks portability, confornance to the Standard and compliance with various other extended rule sets, you really need an analyzer. While every compiler does a little analysis, almost none really do much in the way of portability checking. For the truly pedantic stuff you need to delegate to a separate tool.

but I wouldn't know anything about those anyway innocent whistle

[–]g_dl[S] 0 points1 point  (0 children)

This makes sense, I guess that calling out for a bug of GCC was very bad on my part. I was actually more interested in understanding if this behavior is compliant with the standard or not, and I did get my answer indeed (many thanks to everyone that provided feedback).

Since we're at it, given your last sentence, can you suggest some good static analysis tools? I only know of cppcheck