Subject: [PATCH] ISO C99 does not support _Noreturn

From: Helmut Eller <[email-masked]>
Date: Thu, 26 Jun 2025 09:20:51 +0200

Tags: patch

When I use gcc 14 with -std=gnu99 -Wpedantic I get lots of warnings of
the form

 warning: ISO C99 does not support ‘_Noreturn’ [-Wpedantic].

To avoid those warnings, I propose to use __attribute__ ((__noreturn__))
instead.

>From a5abe534d42b07f585166ee5c1422e72c66b14aa Mon Sep 17 00:00:00 2001
From: Helmut Eller <[email-masked]>
Date: Thu, 26 Jun 2025 08:57:55 +0200
Subject: [PATCH] Don't use _Noreturn with GCC unless __STDC_VERSION__ >=
 201112

This is intended to support -std=gnu99 -Wpedantic.

* m4/gnulib-common.m4 (_Noreturn): Use __attribute__ ((__noreturn__))
instead.
---
 m4/gnulib-common.m4 | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index a07c7dd5a89..9aa30789022 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -78,10 +78,9 @@ AC_DEFUN
 # elif ((!defined __cplusplus || defined __clang__) \
         && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
             || (!defined __STRICT_ANSI__ \
-                && (_GL_GNUC_PREREQ (4, 7) \
-                    || (defined __apple_build_version__ \
-                        ? 6000000 <= __apple_build_version__ \
-                        : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+                && (defined __apple_build_version__ \
+		    ? 6000000 <= __apple_build_version__ \
+		    : 3 < __clang_major__ + (5 <= __clang_minor__)))))
    /* _Noreturn works as-is.  */
 # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-- 
2.39.5