joel.sherrill at OARcorp.com
Thu Dec 8 22:05:50 UTC 2011
On 12/08/2011 11:25 AM, Ralf Corsepius wrote:
> RTEMS contains a set of functions which are implemented as both #defines
> and as normal functions (aka. body functions).
> This raises a couple implementation problems in RTEMS esp, wrt.
> using the compiler to enforce stricter coding standards.
> As things currently appear to me, the only usage of these "body
> functions" is supporting GNAT/Ada, while no pure C application nor RTEMS
> itself uses them - Is this understanding correct?
Any language not C-derived (e.g. other than C/C++)
would have to use the bodies since they can't use the
macros. I am working slowly on Objective-C and I assume
that would be able to use the inline versions.
At the moment non-C languages include Ada, Go, GCJ,
FORTRAN, as well as any assembly language.
It is good form to have bodies of methods in an API that are
implemented as macros because the macros only work in
C (or C-related) languages. Providing real bodies gives you
something to write bindings to.
> Fact seems to be something should be done to get them "out of way" of
> the C-part of RTEMS to simplify improving the coding quality of RTEMS.
> I am not sure what do ... crude, uncooked ideas would be:
> - Split these functions out into a separate library?
Are these causing that many issues? It isn't that much code.
> - Move the "body functions" to cpukit/libgnat?
This one implies they are Ada specific and they are not.
> - Eliminate the #defines and supply C-body functions only?
That would be horrible for performance on many of them.
> It's not clear to me which of these ideas are useful or would really
> make sense.
>  contained in
From what I remember most of those are dedicated files
just to contain the body of the macro version. If you
want to provide a dedicated file for each body implementation
of a macro, then that would certainly be consistent.
> used by:
Yes. They have to be tested for coverage.
We have high standards for coverage and those are necessary
to achieve that.
>  This weeks's PR and patch flood has its origin in me compiling RTEMS
> with very aggressive GCC-warning flags.
> Initial result:>5000 warnings per BSP, with several quite serious ones
> amongst them.
> rtems-devel mailing list
> rtems-devel at rtems.org
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