On Mon, 16 Sep 2024, Pali Rohár wrote:
On Tuesday 17 September 2024 00:26:04 Martin Storsjö wrote:
On Sun, 15 Sep 2024, Pali Rohár wrote:
When compiling any application with flags under gcc 7+ with flags
-D__MINGW_INTRIN_INLINE -Wall -Wextra, it throws about 300 lines of
If I try to build a test program, which only contains "#include <intrin.h>",
nothing else, with GCC 10, with those flags, I get a lot of errors like
"<command-line>: error: expected identifier or ‘(’ before numeric constant".
__MINGW_INTRIN_INLINE should be defined to something like "extern __inline__
__attribute__((__always_inline__,__gnu_inline__))" anyway - and isn't it
always defined?
So I can't reproduce this situation - did you mean some other define?
Yea, I wrote reproducer in another email.
The simple one is just via preprocessor
$ i686-w64-mingw32-cpp mingw-w64-headers/include/psdk_inc/intrin-impl.h
-D__MINGW_INTRIN_INLINE -Wall -Wextra -O2 > /dev/null
Ah, I see
Or calling full compiler via:
$ cat test.c
#include <windows.h>
$ i686-w64-mingw32-gcc -Imingw-w64-headers/include -Wall -Wextra -c test.c
(now without explicit -D__MINGW_INTRIN_INLINE flag)
Right, if passing an explicit -I to the headers directory, I can see how
to trigger it.
I see that I wrote commit message too quickly and incorrectly.
Btw, when dealing with headers, Clang has a behaviour where it normally
silences all warnings from headers that are in the general toolchain
sysroot, considered system headers. So normally we don't see any warnings
from code in headers at all - which is a bit problematic when you want to
investigate issues like these... Does GCC do something like that, or does
GCC normally print all warnings for things in system headers too, in regular
installs?
// Martin
I started compiling mingw-w64 with flags:
./configure --host=i686-w64-mingw32 CPPFLAGS="-I$PWD/mingw-w64-headers/crt/
-I$PWD/mingw-w64-headers/include/"
which allows to compile it at once step without need to install headers
first and separately. And this triggered those warnings.
Also after installing mingw-w64 into $ROOT, I'm just calling it via:
i686-w64-mingw32-gcc -I$ROOT/usr/local/include -B$ROOT/usr/local/lib
(as this does not require to overwrite system mingw-w64 and allows me to
have more mingw-w64 instances with just one gcc compiler binary)
And maybe this is the reason as this is not regular installation and
triggers all those "hidden" warnings. I have not thought about it until
now.
Yes, this explains why you are facing warnings that nobody else are
encountering.
I think, that if you'd use --sysroot rather than manual -I/-L, those
directories could be considered the system headers and get the regular
handling.
In any case - getting rid of warnings in our headers certainly is a good
thing. But the fact that those warnings aren't really visible in regular
installs of the toolchain slightly affects the priority of the matter.
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public