public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50669] New: no warning for unused globals
@ 2011-10-08 22:21 jg at jguk dot org
  2011-10-09 11:38 ` [Bug c/50669] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jg at jguk dot org @ 2011-10-08 22:21 UTC (permalink / raw)
  To: gcc-bugs

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;
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-10 22:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-08 22:21 [Bug c/50669] New: no warning for unused globals jg at jguk dot org
2011-10-09 11:38 ` [Bug c/50669] " rguenth at gcc dot gnu.org
2011-10-09 16:44 ` jg at jguk dot org
2011-10-09 19:35 ` pinskia at gcc dot gnu.org
2011-10-10 22:41 ` jg at jguk dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).