Re: gcc: why is "abcdef"[3] not a constant (error: initializer element is not constant)

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

 



On 05/08/2015 11:21 PM, Ángel González wrote:
> On 08/05/15 17:19, Martin wrote:
> 
> I'm afraid Andrew email was misguided, appearing as rude.

I'm sorry you found it rude.  I thought it matched the tone of the OP
quite nicely.  It certainly was not misguided: nay, it was correct,
and pointed the OP to the relevant section of the language
specification.  Polite but incorrect postings are ten a penny.

> gcc has many extensions, and there's no reason it couldn't add this
> one, which I agree would be useful.

I think you'll find there are not many recent ones.  We're a lot less
eager to add nonstandard extensions to GCC than we were in the past.
Specifying them precisely is very difficult, and we'd have to add
carefully-written tests.  In the past GCC extensions have been rather
underspecified and have led to problems.  The question is whether this
particular extension is worth the effort.  In any case it would take
some time, so it isn't going to be a solution for the OP's current
problem.

The other question is whether accepting nonstandard code by default is
wise.  We have seen that some compilers used by the OP did, and led
him to believe that his code was correct, even to the extent of
believing that GCC was defective.

Andrew.




[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