>From a1433e1b1f692c6ae062305d4c683efafb087b38 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Aug 2020 14:45:38 -0700 Subject: [PATCH 1/2] =?UTF-8?q?libc-config:=20avoid=20Clang=E2=80=99s=20?= =?UTF-8?q?=5F=5Fdiagnose=5Fif=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/cdefs.h (__warndecl, __warnattr, __errordecl): For now, do not use __diagnose_if__ here, as this fails on Fedora 31 with Clang 9.0.1, with diagnostic "/usr/include/bits/stdio2.h:263:9: error: fgets called with bigger size than length of destination buffer [-Werror,-Wuser-defined-warnings]". I guess Clang 9 warns even for functions that are not called? --- ChangeLog | 9 +++++++++ lib/cdefs.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cd00997a9..ba521c265 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2020-08-17 Paul Eggert + libc-config: avoid Clang’s __diagnose_if__ + * lib/cdefs.h (__warndecl, __warnattr, __errordecl): + For now, do not use __diagnose_if__ here, as this fails + on Fedora 31 with Clang 9.0.1, with diagnostic + "/usr/include/bits/stdio2.h:263:9: error: fgets called with bigger + size than length of destination buffer + [-Werror,-Wuser-defined-warnings]". I guess Clang 9 warns even + for functions that are not called? + careadlinkat: speedup for GCC 10 with GCC_LINT Inspired by a suggestion by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2020-08/msg00155.html diff --git a/lib/cdefs.h b/lib/cdefs.h index 74da73404..32a2c40c6 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -148,7 +148,7 @@ # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) -#elif __glibc_clang_has_attribute (__diagnose_if__) +#elif __glibc_clang_has_attribute (__diagnose_if__) && 0 /* fails on Fedora 31 with Clang 9. */ # define __warndecl(name, msg) \ extern void name (void) __attribute__((__diagnose_if__ (1, msg, "warning"))) # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) -- 2.17.1