[PATCH 04/14] FreeBSD update of __GNUCLIKE_ASM, etc.

Sebastian Huber sebastian.huber@embedded-brains.de
Wed Apr 17 14:35:00 GMT 2013


On 04/17/2013 04:24 PM, Craig Howland wrote:
> On 04/17/2013 09:16 AM, Sebastian Huber wrote:
>> These defines are used by FreeBSD header and source files.
>>
>> newlib/ChangeLog
>> 2013-04-17  Sebastian Huber <sebastian.huber@embedded-brains.de>
>>
>>     * libc/include/sys/cdefs.h (__CC_SUPPORTS_DYNAMIC_ARRAY_INIT):
>>     New define.
>>     ....
>> ---
>>   newlib/libc/include/sys/cdefs.h |   66 +++++++++++++++++++++++++++++++++++++++
>>   1 files changed, 66 insertions(+), 0 deletions(-)
>>
>> diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h
>> index fbcd024..b4bc272 100644
>> --- a/newlib/libc/include/sys/cdefs.h
>> +++ b/newlib/libc/include/sys/cdefs.h
>> @@ -106,6 +106,72 @@
>>   #endif
>>   /*
>> + * This code has been put in place to help reduce the addition of
>> + * compiler specific defines in FreeBSD code.  It helps to aid in
>> + * having a compiler-agnostic source tree.
>> + */
> This is a clear delineation of the start of a block for a particular purpose,
> but it is not clear when it ends.  Should an "end of" marker be added (as an
> aid for future maintenance)?
>> +
>> +#if defined(__GNUC__) || defined(__INTEL_COMPILER)
[...]
>> +#endif /* __GNUC__ || __INTEL_COMPILER */
>> +
>> +/*
> Add something like "/* End of code to help reduce the addition of compiler
> specific defines in FreeBSD code.  */" here?
>>    * Given the pointer x to the member m of the struct s, return
>>    * a pointer to the containing structure.  When using GCC, we first
>>    * assign pointer x to a local variable, to check that its type is

In the resulting (after all patches) <sys/cdefs.h> the end of block is 
implicitly visible with a comment that starts a new block:

/*
  * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
  * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI

In case something is hard to read in the resulting file, then we should address 
this at some time on a FreeBSD list.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Newlib mailing list