Richard Henderson schrieb:
> On 04/06/2010 04:44 AM, Stefan Weil wrote:
>   
>> +#if EEPROM_SIZE > 0
>>      /* Add 64 * 2 EEPROM. i82557 and i82558 support a 64 word EEPROM,
>>       * i82559 and later support 64 or 256 word EEPROM. */
>>      s->eeprom = eeprom93xx_new(EEPROM_SIZE);
>> +#endif
>>     
>
> If EEPROM_SIZE is known to be defined, even if zero, it is
> better to write this as a C if, not a preprocessor ifdef.
> Let the compiler eliminate the dead code for you.
>
>
> r~
>   

Why do you think that a C if is better than a CPP if
in this case?

Some compilers give warnings for code which will
never be reached. Try gcc -Wunreachable-code.
It's a really useful option which sometimes even
detects programming errors, so maybe it would
be good for qemu, too.

Stefan



Reply via email to