Macro inflation [was: Re: change log for rtems (2010-09-08)]

Thomas Dörfler Thomas.Doerfler at embedded-brains.de
Fri Sep 10 06:45:29 UTC 2010


Eric, Ralf,

obviously we have different opinions here. Once again: I agree that a
different namespace is required for these definitions, but I think the
macros _do_ improve readability.

I would like to move the discussion back to the rtems-vc mailing list to
allow Sebastian to express his opinions.

wkr,

Thomas.

On 09.09.2010 15:43, Eric Norum wrote:
> On Sep 9, 2010, at 2:40 AM, Ralf Corsepius wrote:
> 
>> Hi,
>>
>> Sebastian Huber committed the patch to CVS, yesterday. Unfortunately nobody so far has responded to my remark.
>>
>> Therefore, I don't see another alternative but to bring this to the attention of the SC.
>>
>> Rationale:
>>
>> a) this patch is bad code and must be removed.
>> The macros are not namespace safe and thus are likely to clash with other macros. E.g. using a macro called BIT8 is grossly negligant.
>>
>> b) I fundamentally question the usefulness and the correctness of this file and consider this code to be dirty.
>>
>>
>> Ralf
> 
> 
> I'm 100% in agreement with Ralf here.
> Namespace pollution is a serious issue.
> The macros don't do anything to improve readability of the code in which they are used.  If someone doesn't understand the C idioms for bit-set, bit-test, bit-clear, etc. they probably shouldn't be trying to program device I/O routines.
> 


-- 

--------------------------------------------
Embedded Brains GmbH
Thomas Doerfler        Obere Lagerstrasse 30
D-82178 Puchheim       Germany
email: Thomas.Doerfler at embedded-brains.de
Phone: +49-89-18908079-2
Fax:   +49-89-18908079-9



More information about the vc mailing list