[Top][All Lists]

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

Re: [avr-gcc-list] Can enumerator values be used in a #if preprocessordi

From: Bob Paddock
Subject: Re: [avr-gcc-list] Can enumerator values be used in a #if preprocessordirective?
Date: Mon, 29 Aug 2011 15:35:03 -0400

On Mon, Aug 29, 2011 at 3:15 PM, Wim Lewis <address@hidden> wrote:
> On Mon, 29 Aug 2011, Weddington, Eric wrote:
>> For the preprocessor purposes, I would bet that somehow "last" evaluates
>> to 0, so of course the condition will always be true.

>   "[6] Identifiers that are not macros, which are all considered to be
>        the number zero. [....]"

Adding -Wundef to avr-gcc test.c now gets the same error.
I already had that in my project Makefile along with all the other warnings.

So that explains the difference.  Seems like there could be a better
error message for this case, 'don't use enum here', alas "The
preprocessor does not know anything about types in the language"...

Thank you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]