type0identifiers as identifier

vijay nag vijunag@gmail.com
Fri Mar 18 16:24:00 GMT 2016


Hello GCC,

GCC compiles the below code snippet without any noise though the
type-identifier "foo" is used as identifier in the function
PrintHello.

My C99 parser failed to parse and I'm wondering if it is a GNU
extension ? Can someone give plausible explanation as  to why it is a
legitimate C program ?

typedef int foo;

static int PrintHello(int val)
{
    int foo;

    printf("Hello world\n");

    return foo;
}

int main()
{
  PrintHell();
}



More information about the Gcc-help mailing list