This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Declarations after statements in front ends


Robert Dewar <dewar@gnat.com> writes:

> Zack Weinberg wrote:
>
>> I would go even farther, and say that *all* front ends must be coded
>> in ISO C90, and we should be compiling everything with -pedantic.
>
> I don't see the need for this restriction. It seems to me that only
> the C compiler need obey this rule. I see no reason why other front
> ends cannot use GNU C extensions. So Zack, can you give your
> reasoning here. To me, the restriction in non-C front ends seems
> unnecessary and unhelpful.

There's generally no good reason to use GNU C extensions in non-C
front ends, though, and enforcing a consistent coding style across the
entire compiler makes life simpler for everyone.  Also, it can be
convenient during development to build everything with whatever
compiler you've got lying around.

(Where GNU C extensions *are* actively useful - the statement
expressions in the checking macros, for instance - they should be
guarded with appropriate #ifdefs and marked with __extension__.)

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]