Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Phil Budne
Thu, 01 Mar 1990 05:35
gcc -Wshadow bug in 1.36 and 1.37.1
Author: Phil Budne
Date: Thu, 01 Mar 1990 05:35
Date: Thu, 01 Mar 1990 05:35
66 lines
2185 bytes
2185 bytes
Summary:
undeclared variables (within functions) cause spurious shadow
warnings for argument declarations in in gcc versions 1.36 &
1.37.1 on Sun4 (and Sun3).
The spurious warning is output twice! Once at "top level"
and once in the new function.
Wishes:
-WALL turned on ALL warnings and that -w<name> could be used to
subtract from the warning set. i.e. gcc -WALL -wcomment
Repeat By:
Script started on Thu Mar 1 00:20:25 1990
bu-it% cat xxx.c
struct {
int member;
} x;
extern void boring( int arg );
# ifdef BUG
void a(void) {
boring( member ); /* typo (x.member) */
}
# endif
void b( int member ) {
boring( member );
}
bu-it% gcc -v
gcc version 1.36
bu-it% arch
sun4
bu-it% gcc -c -Wshadow xxx.c
bu-it% gcc -c -Wshadow -DBUG xxx.c
xxx.c: In function a:
xxx.c:9: `member' undeclared (first use this function)
xxx.c:9: (Each undeclared identifier is reported only once
xxx.c:9: for each function it appears in.)
xxx.c: At top level:
xxx.c:13: warning: declaration of `member' shadows global declaration
xxx.c: In function b:
xxx.c:13: warning: declaration of `member' shadows global declaration
bu-it% rsh pub !-4
rsh pub gcc -v
gcc version 1.37.1
bu-it% rsh pub !-4
rsh pub arch
sun4
bu-it% rsh pub !-4
rsh pub gcc -c -Wshadow xxx.c
bu-it% rsh pub !-4
rsh pub gcc -c -Wshadow -DBUG xxx.c
xxx.c: In function a:
xxx.c:9: `member' undeclared (first use this function)
xxx.c:9: (Each undeclared identifier is reported only once
xxx.c:9: for each function it appears in.)
xxx.c: At top level:
xxx.c:13: warning: declaration of `member' shadows global declaration
xxx.c: In function b:
xxx.c:13: warning: declaration of `member' shadows global declaration
bu-it% exit
script done on Thu Mar 1 00:23:21 1990
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads