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

Joel Sherrill joel at rtems.org
Thu Sep 13 12:14:05 UTC 2018


On Thu, Sep 13, 2018, 12:39 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

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

We should test this and make it a requirement.

The requirements of the FACE Technical Standard require C99, C++03, ARINF
653, and POSIX with a focus on four subsets which match aviation
qualification precedents.

C11 as well as newer versions of C++ (at least to 2014) are being evaluated
for inclusion in the next major edition which is a while away. There is no
use of these in qualified applications based on the experiences of the RTOS
vendors who participate.

Based on the usage reported by the other RTOS vendors and FACE
requirements, I think we need to ensure that all major API headers work
with C99 and C++03 as a baseline.

This may result in variants of psxhdr as well as similar Classic API tests.

--joel

>
> --
> 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.
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180913/c0971c33/attachment-0002.html>


More information about the devel mailing list