bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] regex: fix broken clang build


From: Bruno Haible
Subject: Re: [PATCH 1/1] regex: fix broken clang build
Date: Fri, 17 Jun 2022 01:57:28 +0200

Paul Eggert wrote:
> >                         (defined __apple_build_version__ \
> >                          ? 6000000 <= __apple_build_version__ \
> >                          : 3 < __clang_major__ + (9 <= __clang_minor__))
> This should be protected by defined __clang_major__ for the same reason 
> that __GNUC__ has similar protection.

OK.

> Also, I looked at the source code for old Clang releases for my 
> statement in <https://lists.gnu.org/r/bug-gnulib/2022-06/msg00063.html> 
> that support for -Wvla was added in Clang 2.8, so we can use that for 
> __clang_major__ and __clang_minor__.

I agree. The test case compiles fine, without warning, also with clang 2.8.
(Without the #pragma, it does not produce a warning, though. I.e. the warning
in this precise spot in regex.h was only introduced after clang 2.8. But this
is irrelevant.)

> I don't know which (if any) Apple build version corresponds to 2.8.

I think in a first approximation we can use the same condition as elsewhere:
  6000000 <= __apple_build_version__

> Also, is a change needed in regex.h but not regex.c because different 
> warning flags are used to compile regex.c vs regex.h's other includers? 

Yes, that's my understanding. regex.c is only compiled as part of the gnulib-
imported subdirectory, and since 2022-01-05 we compile it with '-Wno-error'.
Whereas regex.h is also included from the program's (GRUB's) main sources,
where we don't control which compiler options are used.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]