[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/22] c: adjust _Noreturn to pedantic clang
From: |
Akim Demaille |
Subject: |
[PATCH 01/22] c: adjust _Noreturn to pedantic clang |
Date: |
Sat, 23 Jan 2021 15:55:40 +0100 |
Reported by Joe Nelson <joe@begriffs.com>.
https://lists.gnu.org/r/help-bison/2021-01/msg00004.html
Fixed by Paul Eggert in gnulib.
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00156.html
* data/skeletons/c.m4 (b4_attribute_define): Adjust _Noreturn to
pedantic clang.
---
data/skeletons/c.m4 | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/data/skeletons/c.m4 b/data/skeletons/c.m4
index 14a16a9d7..8c08b0a57 100644
--- a/data/skeletons/c.m4
+++ b/data/skeletons/c.m4
@@ -378,14 +378,16 @@ dnl use C' _Noreturn in C++, to avoid -Wc11-extensions
warnings.
&& ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
|| (defined _MSC_VER && 1900 <= _MSC_VER)))
# define _Noreturn [[noreturn]]
-# elif (!defined __cplusplus \
- && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
- || (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
- : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (__4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
/* _Noreturn works as-is. */
-# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
+# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
+ || 0x5110 <= __SUNPRO_C)
# define _Noreturn __attribute__ ((__noreturn__))
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
--
2.30.0
- [PATCH 00/22] maint: prepare 3.7.5, Akim Demaille, 2021/01/23
- [PATCH 01/22] c: adjust _Noreturn to pedantic clang,
Akim Demaille <=
- [PATCH 02/22] autoconf: update, Akim Demaille, 2021/01/23
- [PATCH 03/22] examples: avoid "unbound variable" errors, Akim Demaille, 2021/01/23
- [PATCH 04/22] c++: use noexcept where appropriate, Akim Demaille, 2021/01/23
- [PATCH 05/22] tables: avoid warnings and save bits, Akim Demaille, 2021/01/23
- [PATCH 06/22] glr.cc: don't "leak" yyparse, Akim Demaille, 2021/01/23
- [PATCH 07/22] c++: I'm tired of Flex's warnings, Akim Demaille, 2021/01/23
- [PATCH 08/22] cex: send traces to stderr, not stdout, Akim Demaille, 2021/01/23
- [PATCH 09/22] cex: add support for $TIME_LIMIT, Akim Demaille, 2021/01/23
- [PATCH 10/22] cex: fix traces: add missing end-of-lines, Akim Demaille, 2021/01/23
- [PATCH 11/22] cex: fix traces: fix display of disabled items, Akim Demaille, 2021/01/23