confdefs.h bintime undefined compile error
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Jul 25 07:06:43 UTC 2022
On 25/07/2022 01:04, Joel Sherrill wrote:> On Sun, Jul 24, 2022 at 11:20
AM Joel Sherrill <joel at rtems.org
> <mailto:joel at rtems.org>> wrote:
>
> Hi
>
> Attached is a pretty simple RTEMS application that does not compile
> when -std=c99 is included on the compile line.
>
> 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
> 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,
> from
> /home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/confdefs.h:70,
> from /tmp/rtems_config.c:21:
> /home/joel/rtems-work/tools/6/bsp-install/arm-rtems6/xilinx_zynq_a9_qemu/lib/include/rtems/imfs.h:
> In function '_IMFS_get_time':
> /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
> 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.
>
>
> 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.
The use of this structure is in _IMFS_get_time() which is an internal
IMFS function. I think we need an imfsimpl.h header file for the IMFS
implementation. There are too many details exposed to the application
configuration.
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
More information about the devel
mailing list