[Bug c/11246] New: warning: no previous prototype for foobar_func ()

saptor at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 18 22:42:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: warning: no previous prototype for foobar_func ()
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: saptor@hotmail.com
                CC: gcc-bugs@gcc.gnu.org

Compile with -Wmissing-prototypes turned on.  Code:

int foo();

int main()
{
   foo();
   return 0;
}

int foo()
{
   return 0;
}

Produces this output:
$ gcc -Wmissing-prototypes foo.c
foo.c:10: warning: no previous prototype for `foo'

I've tested this behaviour in GCC 2.95, 3.2.3, and 3.3.   Changing the prototype
to foo(void) makes the warning go away.

Someone reported this bug before but it was closed due to inactivity:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7749



More information about the Gcc-bugs mailing list