Re: Gcc extension: have a semicolon after a function definition ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Michael Gong" <mwgong@xxxxxxxxxxxxxx> writes:

Please never send e-mail to both gcc and gcc-help.  That is pointless.
This question is appropriate for gcc-help, not gcc.

> I am wondering why following program is compiled successfully by gcc ?
> Please notice there is a ";" after the function definition.
> 
> Is there a gcc extension for it ?
> 
> /* foo.c */
> int main() {
>     printf("hello world\n");
> } ;

I believe the semicolon is simply a declaration statement (e.g.,
"extern int i;") which doesn't happen to declare anything.

If you find something in the C standard which says that this should be
prohibited, please file a bug as described in
    http://gcc.gnu.org/bugs.html
Thanks.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux