This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc extension: have a semicolon after a function definition ??
- From: "Michael Gong" <mwgong at cs dot toronto dot edu>
- To: "Andrew Pinski" <pinskia at physics dot uc dot edu>
- Cc: <gcc-help at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>
- Date: Tue, 8 Aug 2006 16:48:06 -0400
- Subject: Re: Gcc extension: have a semicolon after a function definition ??
- References: <200608082034.k78KYFqv032399@earth.phy.uc.edu>
Yes. Gcc gives a warning under -pedantic.
gcc -pedantic foo.c
foo.c:3: warning: ISO C does not allow extra `;' outside of a function
It looks like an old C syntax.
Regards,
Michael
----- Original Message -----
From: "Andrew Pinski" <pinskia@physics.uc.edu>
To: "Michael Gong" <mwgong@cs.toronto.edu>
Cc: <gcc-help@gcc.gnu.org>; <gcc@gcc.gnu.org>
Sent: Tuesday, August 08, 2006 4:34 PM
Subject: Re: Gcc extension: have a semicolon after a function definition ??
Hi,
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 ?
Yes, use -pedantic-errors for showing if it is a GCC extension or not.
-- Pinski