PATCH: Use enum instead of nested macros

David Daney ddaney@caviumnetworks.com
Fri Oct 16 00:41:00 GMT 2009


H.J. Lu wrote:
> On Thu, Oct 15, 2009 at 4:46 PM, David Daney <ddaney@caviumnetworks.com> wrote:
>> H.J. Lu wrote:
>>> I am checking in this patch to use enum instead of nested macros.
>> [...]
>>> +enum
>>> +{
>>> +  REG_80 = 0,
>>> +  REG_81 = REG_80 + 1,
>>> +  REG_82 = REG_81 + 1,
>> Am I missing something, or is every single one of your ' = foo + 1' in this
>> patch completely redundant?
> 
> Do all compiler guarantee that bar == 1 with
> 
> enum
> {
>   foo = 0,
>   bar
> };
> 

No, only those that implement standard C.

David Daney



More information about the Binutils mailing list