[Bug c/57201] Using --save-temps affects whether warning is printed
jasonwucj at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed May 8 14:37:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57201
Chung-Ju Wu <jasonwucj at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jasonwucj at gmail dot com
--- Comment #10 from Chung-Ju Wu <jasonwucj at gmail dot com> 2013-05-08 14:36:58 UTC ---
(In reply to comment #2)
> I should have clarified that the warning is correct with --save-temps. When
> --save-temps is omitted, the warning is missing. That is wrong. There should
> be a warning in this case. The presence of "#define stdout stdout" should not
> inhibit a warning.
>
> Also, this is a regression, as GCC 4.6 does warn for this case (I didn't test
> 4.7).
I tried it on 4.7.3, 4.8-branch, and 4.9-trunk (4.9.0 20130502).
4.7.3 does warn for the case as well.
There is no warning on both 4.8 and 4.9.
---- Console output ----
$ native-toolchain/bin/gcc --version
gcc (20130502) 4.9.0 20130502 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ native-toolchain/bin/gcc -Wall -c ian.c
$ native-toolchain/bin/gcc -Wall -c ian.c --save-temps
ian.c: In function 'f':
ian.c:5:3: warning: statement with no effect [-Wunused-value]
stdout;
^
------------------------
According to comment 8, maybe this is a fix, not a regression?
More information about the Gcc-bugs
mailing list