|
From: | Paul Eggert |
Subject: | Re: Portability issues with scractch_buffer |
Date: | Thu, 21 Jan 2021 17:16:43 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 |
My guess is that the preprocessor expands __has_attribute (__fallthrough__) to 1 but the attribute does not actually work. Is that the case?has_attribute is indeed 1.Looking at the Clang 3.4 source code, I don't see how that could be, as clang-3.4/include/clang/Basic/Attr.td lists the clang::fallthrough attribute for CXX11 but not for C. Possibly I'm misunderstanding that file, but just to check, does your preprocessor version match your compiler version? or are you compiling with clang++?No, this is the genuine C compiler of that version. As provided by Ubuntu.
It turns out that __has_attribute is subtly broken in clang 3.4 and earlier; this is documented in the clang 3.5 release notes. I installed into Gnulib the attached simple workaround to attempt to work around the problem.
This doesn't solve the more-important issue that we have with older clang, but one thing at a time.
0001-Port-FALLTHROUGH-to-clang-3.4-and-earlier.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |