Re: [PATCH] Makefile: FreeBSD cannot do C99-or-below build
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 19, 2022, 00:22 UTC
- Message-ID
- <xmqqzgnspob6.fsf@gitster.g>
- In-Reply-To
- <220119.861r14pomb.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 20 quoted lines
> On Tue, Jan 18 2022, Neeraj Singh wrote: > >> The approach of building with C11 on FreeBSD is a good one >> compared to trying to hack around the headers. > > The "hack around the headers" suggests that you've seen my > alternate[1].... > >> It appears more like a compiler bug that's being worked around >> here. The FreeBSD header supposedly uses a GCC extension if the >> C standard version is less than C11. See: >> https://github.com/freebsd/freebsd-src/blob/1e7b5f950b2d54ddb257d008592563c4d753aa54/sys/sys/cdefs.h#L317 > > ...which discusses how the line you're linking to here and > __has_extension() interact, it's not a compiler bug, unless I'm missing > something. > > I.e. it's just a FreeBSD include asking the compiler the wrong question > and/or not suppressing the warning (e.g. via "#pragma clang > system_header").
Yup, I do agree with you that this looks more like a bug in the header files.