This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-1.1 gcc bug: missing `unused parameter' warnings


The following source file fails to give an unused parameter warning
when compiled with gcc -O -Wall -W (egcs 1.1 on
i586-pc-linux-gnulibc1).  When compiled without optimization but with
the same warning options, it gives the correct warning.

======================================================================
int
f(c)
	char c;
{
	return 0;
}
======================================================================

$ gcc -v -O -S -Wall -W t.i
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/cc1 t.i -quiet -O -Wall -W -version -o t.s
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
$ gcc -v -S -Wall -W t.i
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/cc1 t.i -quiet -Wall -W -version -o t.s
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
t.i: In function `f':
t.i:3: warning: unused parameter `c'
$ 


-- 
Joseph S. Myers
jsm28@cam.ac.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]