Open dmik opened 3 years ago
Quick testing shows that # include_next <fenv.h>
includes the same /usr/include/c++/9/fenv.h
file again instead of going to a next directory in the include search list and finally find /usr/include/fenv.h
. And I guess I know why. Here is the result of running g++ -E -x c++ - -v < /dev/null
:
Using built-in specs.
COLLECT_GCC=C:\USR\BIN\g++.exe
Target: i686-pc-os2-emx
Configured with: D:/Users/dmik/rpmbuild/BUILD/gcc-9.2.0/configure --disable-bootstrap --enable-languages=c,c++ --build=i686-pc-os2-emx --with-sysroot=/@unixroot --prefix=/@unixroot/usr --mandir=/@unixroot/usr/share/man --infodir=/@unixroot/usr/share/info --with-bugurl=https://github.com/bitwiseworks/gcc-os2/issues --enable-shared --enable-threads --enable-checking=release --disable-multilib --with-system-zlib --with-gcc-major-version-only --without-isl --with-tune=generic --with-arch=i686 --with-gnu-as --disable-libstdcxx-pch
Thread model: os2
gcc version 9.2.0 20190812 (OS/2 RPM build 9.2.0-5) (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i686'
C:/usr/bin/../libexec/gcc/i686-pc-os2-emx/9/cc1plus.exe -E -quiet -v -iprefix C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/ - -mtune=generic -march=i686
ignoring nonexistent directory "C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/../../../../i686-pc-os2-emx/include"
ignoring nonexistent directory "C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/../../../../i686-pc-os2-emx/include"
#include "..." search starts here:
#include <...> search starts here:
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9/i686-pc-os2-emx
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9/backward
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/include
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/include-fixed
C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9
C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9/i686-pc-os2-emx
C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/../../../../include/c++/9/backward
C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/include
/@unixroot/usr/local/include
C:/usr/bin/../lib/gcc/../../lib/gcc/i686-pc-os2-emx/9/include-fixed
/@unixroot/usr/include
End of search list.
Due to some mess with resolving relative paths, include/c++/9
appears twice on the search list and hence the result. This looks like a gcc configure/compile time issue. Needs debugging.
Test case:
Output:
It's unclear why it happens as LIBC
fenv.h
contains all declarations that are needed here. Looks like# include_next <fenv.h>
in/usr/include/c++/9/fenv.h
for some reason has no effect... This header is simply not included. Weird.