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 10:22 AM, m-h-l wrote:

> What can be more constant than  "12345"[3] ?

It's not a constant because the C language specification says it's not
a constant.  We could treat it as a constant in GCC, but then our
compiler would be wrong according to the specification of the
language.  We don't get to just make stuff up.

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