[LinuxBIOS] [RFC] Macros vs. functions for better readability

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sun Jan 6 23:55:42 CET 2008


On 06.01.2008 23:41, ron minnich wrote:
> On Jan 6, 2008 1:43 PM, Juergen Beisert <juergen127 at kreuzholzen.de> wrote:
>
>   
>> getCx86 and setCx86 defined as inline functions are working in all cases. So:
>> Do not use macros as functions.
>>     
>
> That's a good point. It's easy to get fooled by macros.
>   

Macros have one big advantage as function wrappers, though: Their
arguments do not have to contain all arguments to the wrapped functions.
However, a macros MUST be easily visible as such to avoid "clever" usage.


Regards,
Carl-Daniel




More information about the coreboot mailing list