[Bug 1742] Warnings in system headers

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Feb 24 14:40:30 UTC 2011


--- Comment #8 from Ralf Corsepius <ralf.corsepius at rtems.org> 2011-02-24 08:40:28 CST ---
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > Thus it is natural to use the
> > > definitions from <sys/cdefs.h> in <rtems/bsd/sys/cdefs.h>.
> > No ... <rtems/bsd/sys/cdefs.h> _replaces_ <sys/cdefs.h>
> Would it then make sense to eliminate the content of <sys/cdefs.h>?
Depends on what you mean.

Inside of the RTEMS source-tree all sources use <rtems/bsd/sys/cdefs.h>. 
i.e. inside of RTEMS usage of <sys/cdefs.h> is eliminated.

This allows RTEMS to adapt to avoid their <sys/cdefs.h>.

> or colide
> it to
> ------------
> sys/cdefs.h:
> #include <rtems/bsd/sys/cdefs.h>
> ------------
> I don't understand the rational of having to (rather) similar files available.

Remember <sys/cdefs.h> is not covered by any standard, nevertheless most libcs
have one (<sys/cdefs.h> is BSD)

I.e. to be able to compile RTEMS against different libcs using <sys/cdefs.h>,
RTEMS would have to cater all these <sys/cdefs.h> 

=> We would end up in a portability swamp, when sources originating from
different BSDs will be introduced into RTEMS or when RTEMS will be built
against other libcs.

Remember the POSIX/unix BSP - It was the actual origih of this construct.

Another hidden aspect: Adding -I..../rtems/bsd can be applied as BSD transition
aid. Do you remember our bsd transition helper discussion from ca. 2 years ago?
This is one of these.

> You are right, it did not do any harm up to now, but since we are discussing
> it now it might be the right time to fix this.
As I tried to express before, the working principle might be a bit over the top
for people who are not familiar with the code, but I can only reiterate: I
don't see anything wrong with it.

If there is an issue, then it's RTEMS having abandoned supporting other libcs
but newlib. The solution then would be to remove "rtems/bsd/" (comprising
<rtems/bsd/sys/cdefs.h>) and to rely upon newlib's <sys/cdefs.h> only.

I am having no problems with this - The first ones to yell at me will be Joel
(who will likely loose schedsim) and those who have BSD-derived works in their
non-opensource drawers (I.e. likely you).

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list