gcc is supposed to warn, by default, if a program ignores the return value of a function declared with __attribute_warn_unused_result__. And indeed, if I write any simple program including <stdio.h> and calling fscanf (but ignoring its return value), CodeBlocks will issue the appropriate warning. But if I compile that same program in a terminal window with simply:
gcc myprog.c
there is no warning. As far as I can see, I shouldn't have to supply any options to get the warning.
My question is: is CodeBlocks doing something special to produce that "default" warning? How can I see the exact compiler command that CodeBlocks is using?
I'm using Ubuntu 10.04 with gcc 4.4.3 (from Ubuntu repository) and CodeBlocks svn build rev 7548 (also from the Ubuntu repository). Also tried compiling in Debian Lenny on the command line and I don't get the warnings there either.