[PATCH] score: Change _Heap_Extend() API

Joel Sherrill joel.sherrill at OARcorp.com
Fri Aug 10 13:26:11 UTC 2012


On 08/10/2012 03:59 AM, Sebastian Huber wrote:
> On 08/09/2012 05:50 PM, Joel Sherrill wrote:
>> Sorry to keep pestering but we ended up with a deliberately unused
>> parameter. Does that give a warning?
> With the standard warning flags "-Wall -Wmissing-prototypes
> -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs" I get no
> error.
>
>> Do we need to use the gcc pragma to note it is unused? I know in the
>> test code, there is a conditional defined for this. It may have to move
>> into the core like the memory barrier and other compiler specific macros
> There are a lot of __attribute__((unused)) scattered around the code.
>
> We should think about using something similar to the FreeBSD cdefs.h file.
> They do a lot to cope with compiler dependencies, e.g.
>
> #if __GNUC_PREREQ__(2, 7)
> #define	__dead2		__attribute__((__noreturn__))
> #define	__pure2		__attribute__((__const__))
> #define	__unused	__attribute__((__unused__))
> #define	__used		__attribute__((__used__))
> #define	__packed	__attribute__((__packed__))
> #define	__aligned(x)	__attribute__((__aligned__(x)))
> #define	__section(x)	__attribute__((__section__(x)))
> #endif
>
> This is a lot shorter than the RTEMS_ATTRIBUTE_XXX.
>
It is shorter. I question better because the BSD names already
are duplicated in newlib. With the libbsd work, I have noticed
that the conflicts/duplications for sys/cdefs.h are popping up
again. If we use the same names a third time, this is just going
to be worse.

If we can unify all this, it may be OK.  But sys/cdefs.h definitions
have proven to be a thorn over the past years.

-- 
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