Article View: gnu.gcc.bug
Article #593Incorrect warning
From: Matthew Barry
Date: Thu, 14 Sep 1989 20:44
Date: Thu, 14 Sep 1989 20:44
37 lines
1289 bytes
1289 bytes
The following code produced an invalid warning from gcc:
#include <stdio.h>
static void
x( void )
{
printf( "hello\n" );
}
int
main()
{
/*static*/ void x( void );
x();
return 1;
}
The compilation command was gcc -Wall -O -c t.c.
This error shows up with the gcc patched for protoization and an unpatched
gcc. The compiler was built from the configuraion given by:
config.gcc sun4-os4.
gcc version 1.35.p
/usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -Wall t.c /tmp/cca00805.cpp
GNU CPP version 1.35.p
/usr/local/lib/gcc-cc1 /tmp/cca00805.cpp -quiet -dumpbase t.c -O -Wall -version -o /tmp/cca00805.s
GNU C version 1.35.p (sparc) compiled by GNU C version 1.35.p.
t.c:5: warning: `x' defined but not used
as -o t.o /tmp/cca00805.s
Matthew Barry
Technical Details
Message-ID:
<8909140544.1466@mullian.mu.oz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!mullian.ee.mu.OZ.AU!mebShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!mullian.ee.mu.OZ.AU!meb From: meb@mullian.ee.mu.OZ.AU (Matthew Barry) Newsgroups: gnu.gcc.bug Subject: Incorrect warning Message-ID: <8909140544.1466@mullian.mu.oz> Date: 14 Sep 89 20:44:33 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: meb@mullian.oz.au Distribution: gnu Organization: GNUs Not Usenet Lines: 37