Using gcc version 4.0.0 20050115 (experimental) (Debian 4.0-0pre4)
I see that:

int
main (void)
{

  int a;
  
  static int nested (int b)
    {
      return b + 2;
    }

  return (a + nested (a));  
}

gives:
nested.c: In function 'main':
nested.c:8: error: invalid storage class for function 'nested'

without the "static" I get:

gcc -Wmissing-declarations nested.c
nested.c: In function `main':
nested.c:8: warning: no previous declaration for 'nested'

Has static been deprecated for nested functions? If yes, is there
another way to avoid the warning?

-- 
           Summary: static nested function workaround for -Wmissing-
                    declarations (see bug #1517) no longer works
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bartoldeman at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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

Reply via email to