This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50669] New: no warning for unused globals
- From: "jg at jguk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 08 Oct 2011 22:21:21 +0000
- Subject: [Bug c/50669] New: no warning for unused globals
- Auto-submitted: auto-generated
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;
}