Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Hi Simon,
>
>> command-line option '-Wzero-as-null-pointer-constant' is valid for
>> C++/ObjC++ but not for C [-Werror]
>> 
>> https://gitlab.com/libidn/libidn/-/jobs/17647596942
>> 
>> The compiler is x86_64-w64-mingw32-gcc from Debian 13 trixie mingw-w64.
>
> Per [1] this is a gcc 14, which indeed supports this option only for C++.
>
> You are encountering an issue that is fixed in gnulib commit
> 9022a57103a974e35e3f077f52ba0531eb5c81fc (2026-07-08), but your package
> is using the stable branch [2] and therefore does not have this fix.

Ah, thanks for finding that one.  That commit was added in
659b9de65cb04db9b6739c861d4506fff92da542 to stable-202607, so I don't
think tracking gnulib master would make a difference.

I think the problem is that the mingw gcc --version output doesn't
match:

    case $gl_gcc_version in
      *gcc*' ('*') '[[0-9]].* | \
      *gcc*' ('*') '1[[0-4]].*)
        # In GCC < 15 the option either does not exist,
        # or is accepted but always warns.
        ;;
      *)
        AS_VAR_APPEND([$1], [' -Wzero-as-null-pointer-constant'])

$ i686-w64-mingw32-gcc --version|sed q1
i686-w64-mingw32-gcc (GCC) 14-win32
$ i686-w64-mingw32-gcc --version|sed 1q
i686-w64-mingw32-gcc (GCC) 14-win32
$ x86_64-w64-mingw32-gcc --version|sed 1q
x86_64-w64-mingw32-gcc (GCC) 14-win32
$ gcc --version|sed 1q
gcc (Debian 14.2.0-19) 14.2.0

The mingw --version output is rather weird, maybe it should be reported
to report something better (like '14.2.0-win32').

However manywarnings.m4 could also have a more reliable mechanism when
to enable -Wzero-as-null-pointer-constant.

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to