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]

Good reasons why mingling declarations and statements is gnu89?


Is any reason why this C99 feature

    int a = 2;
    printf ("%d", a);
    int b = 3;
    printf ("%d", b);

is enabled by gnu89?  Or is it creeping featurism only?

I have at least three times released code that could only compile on gcc 3.x
when this can be perfectly avoidable.  Why I don't care much about it now,
it was a problem in the 3.0 days, when the feature was introduced and when
few people used the compiler because of problems compiling the Linux kernel.

For one thing, I thought that GNU extensions are there for adding power to
the language, which is not the case (named initializers predating C99, asm,
typeof, &&, and even nested functions all fit this purpose).  Secondly, this
falls in the same category for which -Wall enables warnings -- dubious,
easily fixable constructs.

--pedantic might be an option but I'd like to avoid littering the code with
macros to add __extension__ whenever I use the GCC label-of-address
extension (guarded by __GCC__).

|_  _  _ __
|_)(_)| ),'
------- '---



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