Patches for classic affinity implementation and test

Gedare Bloom gedare at rtems.org
Fri Feb 21 01:49:09 UTC 2014


On Thu, Feb 20, 2014 at 5:54 PM, Joel Sherrill
<joel.sherrill at oarcorp.com> wrote:
>
> On 2/20/2014 4:45 PM, Peter Dufault wrote:
>> On Feb 20, 2014, at 16:11 , Gedare Bloom <gedare at rtems.org> wrote:
>>
>>> +#if __RTEMS_HAVE_SYS_CPUSET_H__
>>> I think we decided to prefer the more explicit "#if defined(...)" for
>>> checking for CPP defines.
>>> Also, what is this define checking against / where is it defined?
>> I think "#if defined()" isn't more explicit unless the test is "#if defined(__RTEMS_HAVE_SYS_CPUSET_H_DEFINED__)" because of the possibility of:
>>
>> #define __RTEMS_HAVE_SYS_CPUSET_H__ 0
>>
>> I just hit this the other day.  I personally don't like #ifdef.
>>
>> "#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && (__RTEMS_HAVE_SYS_CPUSET_H__ != 0)" addresses all possibilities and is kind of like wrapping macros in "do .. while (0)" guards, but it's verbose and odd.
> I have nothing against paranoia but this is unfortunately a pattern
> encouraged
> by autoconf feature macros. If we can come to some agreement on the pattern,
> then it should be possible to write a script to convert from old to new
> pattern.
>
Peter is right.  I looked back at the history I was thinking about,
and we rely on the #if for value checking e.g. for BSPOPTS. While I
prefer to use ifdef for feature flags, the historical use of 0/1 for
the flag makes the ifdef a bug. We should drop this issue for now.

> But arbitrarily using a different pattern in new code isn't good either.
> I would
> rather see a massive sed script to fix them all in one sweep.
>> Peter
>> -----------------
>> Peter Dufault
>> HD Associates, Inc.      Software and System Engineering
>>
>>
>> _______________________________________________
>> rtems-devel mailing list
>> rtems-devel at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-devel
>
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel.sherrill at OARcorp.com        On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
> Support Available                (256) 722-9985
>



More information about the devel mailing list