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: Charconst valuation and short-circuiting


> Should GCC not be attempting to value the character constant in
> the following code (and therefore not give a hard error about
> a too-long charconst?)

> 
> if (0 && 'abcdefghijk')

I don't think so.  It is not unlikely to why you use if's instead
of #ifdef's so that dead code is eliminated but still flags errors.
If you wanted no errors, you'd use a preprocessor condition (I'm assuming
that 0 is valuable at compilation time, and hence at preprocessing time,
maybe with some help from autoconf a la SIZEOF_LONG).

Paolo


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