[Bug c/57201] New: Using --save-temps affects whether warning is printed
ian at airs dot com
gcc-bugzilla@gcc.gnu.org
Wed May 8 00:57:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57201
Bug #: 57201
Summary: Using --save-temps affects whether warning is printed
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ian@airs.com
Consider this C file:
#include <stdio.h>
void
f(void)
{
stdout;
}
When I compile it on my Ubuntu Precise system with GCC 4.8 branch with the
-Wall option, I get no error. When I compile it with -Wall --save-temps, I get
this:
foo.c: In function ‘f’:
foo.c:5:3: warning: statement with no effect [-Wunused-value]
stdout;
^
This appears to happen because <stdio.h> on my system has this line:
#define stdout stdout
When not using --save-temps, something about this is causing
linemap_location_in_system_header_p to return true for "stdout" on line 5.
More information about the Gcc-bugs
mailing list