static int foo(void) { return 7; }
int main()
{
        int foo(void);
        return foo();
}

[EMAIL PROTECTED]:/tmp$ /usr/bin/gcc-3.4 -Wall -c foo.c
foo.c:1: warning: 'foo' defined but not used
[EMAIL PROTECTED]:/tmp$ /usr/bin/gcc-3.4 --version
gcc-3.4 (GCC) 3.4.5 (Debian 3.4.5-1)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[EMAIL PROTECTED]:/tmp$ /usr/bin/gcc-3.2 -Wall -c foo.c
[EMAIL PROTECTED]:/tmp$ /usr/bin/gcc-3.3 -Wall -c foo.c
[EMAIL PROTECTED]:/tmp$ /usr/bin/gcc-4.0 -Wall -c foo.c
[EMAIL PROTECTED]:/tmp$


-- 
           Summary: regression: bogus 'defined but not used' warning
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rusty at rustcorp dot com dot au
  GCC host triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25499

Reply via email to