compile error in RTEMS header when using -std=c99?

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Sep 13 05:39:22 UTC 2018


Hello Alan,

On 12/09/2018 20:45, Cudmore, Alan P. (GSFC-5820) wrote:
>
> Hello,
>
> We are building our RTEMS applications with -std=c99 and other 
> compiler warning switches.
>
> On the latest RTEMS master and RTEMS 5 toolchain ( from yesterday ), 
> when I include the -std=c99 compiler switch, the compilation fails in 
> an RTEMS header.
>

I would not use C99 for multi-threaded programs. C11 is the first C 
standard which knows what a thread is.

> Is it not recommended to use the “-std= “ switches when building RTEMS 
> applications, or is this something that we should fix? We are able to 
> use the “-std=c99” switches in 4.11. I noticed that the timestamp.h 
> file did change between 4.11 and 5.x.
>

Yes, this is a known issue. RTEMS uses now the FreeBSD-specific struct 
bintime and sbintime for its internal timestamps. Unfortunately, this 
implementation detail is leaked via <rtems.h>. There are several ways to 
fix this. We could expose the FreeBSD-specific API unconditionally in 
<sys/types.h>. We could also try to hide this implementation detail from 
<rtems.h>.

Firstly, if it is supposed to compile <rtems.h> with a particular -std=* 
switch, then we should test this.

-- 
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 at embedded-brains.de
PGP     : Public key available on request.

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




More information about the devel mailing list