confdefs.h bintime undefined compile error

Joel Sherrill joel at
Sun Jul 24 16:20:09 UTC 2022


Attached is a pretty simple RTEMS application that does not compile when
-std=c99 is included on the compile line.

arm-rtems6-gcc -B
-qrtems -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9
-O0 -g -ffunction-sections -fdata-sections -g -Wall -std=c99 -pthread
-Wno-nonnull-compare   -c /tmp/rtems_config.c  -o /tmp/rtems_config.o
In file included from
                 from /tmp/rtems_config.c:21:
In function '_IMFS_get_time':
error: storage size of 'now' isn't known
  377 |   struct bintime now;

Dropping -std=c99 resolves this. I'm guessing turning on some BSD
visibility flag would do the same but it shouldn't be needed. Any ideas for
a real fix?

Do we have any test cases which ensure the headers compile as C99? All
published POSIX versions assume C99.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems_config.c
Type: application/octet-stream
Size: 481 bytes
Desc: not available
URL: <>

More information about the devel mailing list