[Bug c/50669] New: no warning for unused globals
jg at jguk dot org
gcc-bugzilla@gcc.gnu.org
Sat Oct 8 22:21:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50669
Bug #: 50669
Summary: no warning for unused globals
Classification: Unclassified
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jg@jguk.org
I see unused warning for item on stack, but not global variale that is unused.
Could gcc also give warnings for unused globals?
jon@laptop:~$ gcc -Wextra -Wunused -Wall -o main main4.c
main4.c: In function ‘main’:
main4.c:9:6: warning: unused variable ‘unused_flag’
Example program follows:
// gcc -Wextra -Wunused -Wall -o main main4.c
int unused_int;
int main(void)
{
int unused_flag;
return 0;
}
More information about the Gcc-bugs
mailing list