lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] [bug #35875] #define ⇒ enum?


From: David Empson
Subject: Re: [lwip-devel] [bug #35875] #define ⇒ enum?
Date: Tue, 20 Mar 2012 10:17:54 +1300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120312 Thunderbird/11.0

One argument against using enums (admittedly weak): some compilers, including one we are using, implement enums as unsigned instead of signed integers, in violation of C standards. Attempting to declare a negative enum value produces an error. I generally prefer to use enums for named constants, but with this compiler I've had to use #define for negative values.

If LWIP switches from #define to enum for declaring constants, and some of the values are negative, our port will have to partly undo these changes and keep using #define for the constants with negative values. From a quick glance, this may only affect err.h and the PPPERR constants in ppp.h so it should be pretty minor.




reply via email to

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