<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 24, 2022 at 11:20 AM Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>Attached is a pretty simple RTEMS application that does not compile when -std=c99 is included on the compile line.</div><div><br></div><div>arm-rtems6-gcc -B /home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/ -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<br>In file included from /home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/confdefs/libio.h:135,<br> from /home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/confdefs.h:70,<br> from /tmp/rtems_config.c:21:<br>/home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/imfs.h: In function '_IMFS_get_time':<br>/home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/imfs.h:377:18: error: storage size of 'now' isn't known<br> 377 | struct bintime now;<br></div><div><br></div><div>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?<br><br>Do we have any test cases which ensure the headers compile as C99? All published POSIX versions assume C99.</div></div></blockquote><div><br></div><div>It isn't just c99. C11 and C17 also cause this. It is turning on the "standard" which turns off many extensions. Internally, this header needs to enable BSD extensions. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>--joel</div></div>
</blockquote></div></div>