]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use only c23 or c11 noreturn specifiers
authorAydın Mercan <aydin@isc.org>
Thu, 11 Jul 2024 13:15:40 +0000 (16:15 +0300)
committerAydın Mercan <aydin@isc.org>
Wed, 7 Aug 2024 15:27:40 +0000 (18:27 +0300)
Since we require C11 or greater, we can depend on using either _Noreturn
or [[noreturn]].

34 files changed:
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/confgen/rndc-confgen.c
bin/confgen/tsig-keygen.c
bin/confgen/util.h
bin/delv/delv.c
bin/dig/dig.c
bin/dig/dighost.h
bin/dig/host.c
bin/dig/nslookup.c
bin/dnssec/dnssec-cds.c
bin/dnssec/dnssec-dsfromkey.c
bin/dnssec/dnssec-importkey.c
bin/dnssec/dnssec-keyfromlabel.c
bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-revoke.c
bin/dnssec/dnssec-settime.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssec-verify.c
bin/dnssec/dnssectool.h
bin/named/include/named/main.h
bin/named/main.c
bin/named/server.c
bin/nsupdate/nsupdate.c
bin/rndc/rndc.c
bin/rndc/util.h
bin/tools/dnstap-read.c
bin/tools/mdig.c
bin/tools/named-rrchecker.c
bin/tools/nsec3hash.c
configure.ac
lib/isc/include/isc/assertions.h
lib/isc/include/isc/attributes.h
lib/isc/include/isc/error.h

index 00335b60899441073b87c881f37d0226151621f7..70b4b317ba1c782425e0cf2ac2da6a1ae6f08ab6 100644 (file)
@@ -54,7 +54,7 @@ isc_log_t *logc = NULL;
        } while (0)
 
 /*% usage */
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index db2e345561f14308951928bbfb057f47dc3bd05d..a0ddf8a94b7ffad7a40cc849679a7ca0a27509dd 100644 (file)
@@ -62,7 +62,7 @@ static enum { progmode_check, progmode_compile } progmode;
                }                                                             \
        } while (0)
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index c840e2c2844e2123dba899fdeda3136c1ec1d283..f96ee47d20d33cf9a695c8471d240ebe94255355 100644 (file)
@@ -60,7 +60,7 @@ bool verbose = false;
 
 const char *keyfile, *keydef;
 
-noreturn static void
+ISC_NORETURN static void
 usage(int status);
 
 static void
index c421702c8bf7b6df19f2bd020bf6287c31955e68..39f13a73fcb328092ea25647157f178b9e974194 100644 (file)
@@ -53,7 +53,7 @@ const char *progname;
 static enum { progmode_keygen, progmode_confgen } progmode;
 bool verbose = false; /* needed by util.c but not used here */
 
-noreturn static void
+ISC_NORETURN static void
 usage(int status);
 
 static void
index 4ac83e5143338f142d8c798a4b74cc056b222359..0567ad33b1dd13c339ee516b67e76dc98d9d4505 100644 (file)
@@ -36,7 +36,7 @@ ISC_LANG_BEGINDECLS
 void
 notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
 
-noreturn void
+ISC_NORETURN void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 ISC_LANG_ENDDECLS
index 36f26f042ca7280dc9c08359ab8aac43ea456878..d494500675735480dfb63f8ee9c7a9b4aefbd090 100644 (file)
@@ -250,7 +250,7 @@ usage(void) {
        exit(EXIT_FAILURE);
 }
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 static void
index e9665c9e015f3511182247ce26fc642b3ee9b751..288b327ef292802d4ccf21650d607d778f2fa68b 100644 (file)
@@ -111,7 +111,7 @@ usage(void) {
        fprintf(stderr, "Press <Help> for complete list of options\n");
 }
 #else  /* if TARGET_OS_IPHONE */
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 99c0c3c8647f68acf9ff6ebbc5f716c86c8f2510..56842f941973de9d96bef33e7b37f6fbdcad9c38 100644 (file)
@@ -293,13 +293,13 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
 isc_result_t
 get_reverse(char *reverse, size_t len, char *value, bool strict);
 
-noreturn void
+ISC_NORETURN void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 void
 warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
-noreturn void
+ISC_NORETURN void
 digexit(void);
 
 void
index 6710c981f16e448186788663a48f0271c0174d23..a44acde55cbd3ab86d9ef696702da2f40a059255 100644 (file)
@@ -99,7 +99,7 @@ rcode_totext(dns_rcode_t rcode) {
        return (totext.deconsttext);
 }
 
-noreturn static void
+ISC_NORETURN static void
 show_usage(void);
 
 static void
index 4b813511b7547322533af484a8c8c5d5548a9b6f..2c892437519ef6ca80b3c977c7469beed1d6cf87 100644 (file)
@@ -836,7 +836,7 @@ fgets_next_command(void *arg) {
        cmdline = fgets(cmdlinebuf, COMMSIZE, stdin);
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index fd877160d8800ccd8c752933780a7bf0323e9902..86aeff0b11d70a5d1931be27f33a2a13a903161e 100644 (file)
@@ -1028,7 +1028,7 @@ nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
        }
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 466f7ce0fe1c7012e5a36fca492602c2fe0e411c..97f2a3780d65eb70cc359804cc1076b9715430ba 100644 (file)
@@ -324,7 +324,7 @@ emits(bool showall, bool cds, dns_rdata_t *rdata) {
        }
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 3bb40290528d41d73a2596050e9bccb2a4d7a84f..165707d553045fd9a79b5ffae15b880feabe7653 100644 (file)
@@ -262,7 +262,7 @@ emit(const char *dir, dns_rdata_t *rdata) {
        dst_key_free(&key);
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index a4afc1f66a03afcb30fef27d08c4689a9c126815..ce823e8f83351452a80f438be88c3a797728be33 100644 (file)
@@ -43,7 +43,7 @@
 
 const char *program = "dnssec-keyfromlabel";
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 5dce14964f0d664ba92fa1b8c644e3d7551fef94..ffcbaba23e44dc28b4caf519c1c30acb4dc05408 100644 (file)
@@ -74,7 +74,7 @@ static int min_dh = 128;
 
 isc_log_t *lctx = NULL;
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index bc2ca62bf2ab7e46f8d3687b96f12ef879e8e928..92169ca7b6839b17ad9bdf7ccf7e429f6e2895ac 100644 (file)
@@ -38,7 +38,7 @@ const char *program = "dnssec-revoke";
 
 static isc_mem_t *mctx = NULL;
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 3ca072f0e4d348391c172cd93de5cc2f100208d4..5b630ab115ebb264d6cf7ac21d35fe72b5cfc6e2 100644 (file)
@@ -42,7 +42,7 @@ const char *program = "dnssec-settime";
 
 static isc_mem_t *mctx = NULL;
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index e17f85325d99da16d622d412a401bc1c1ab9c04b..82d4cf0721b61055d9657ea7402ba241d0579f50 100644 (file)
@@ -3201,7 +3201,7 @@ print_version(FILE *fp) {
        fprintf(fp, "; %s version %s\n", program, PACKAGE_VERSION);
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index 913f463ae54c63e52e44b43ba2e944822b44780f..ce7101c5941ad9cf7f06bbcce5eb38fc115258dc 100644 (file)
@@ -136,7 +136,7 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
        }
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
index aac6a709add29ec8d2932299b7a5cf454592952e..1107fa7eb19a94bc9dae044599c21f033bb00ab6 100644 (file)
@@ -54,7 +54,7 @@ extern uint8_t dtype[8];
 
 typedef void(fatalcallback_t)(void);
 
-noreturn void
+ISC_NORETURN void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 void
@@ -66,7 +66,7 @@ check_result(isc_result_t result, const char *message);
 void
 vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
 
-noreturn void
+ISC_NORETURN void
 version(const char *program);
 
 void
index bed5dd9787c128d91325caa7639aae0dc470182c..7cf35e0a212b9f718ee5dcb51a9a878745c11695 100644 (file)
@@ -26,7 +26,7 @@
  */
 #define NAMED_MAIN_ARGS "46A:c:Cd:D:E:fFgL:M:m:n:N:p:sS:t:T:U:u:vVx:X:"
 
-noreturn void
+ISC_NORETURN void
 named_main_earlyfatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 void
index 274c2bbe2c36ad3c64216c6f41a2b59447f8d21d..0d6af4115a1ade7458aa6bf456a27788c3063c80 100644 (file)
@@ -197,7 +197,7 @@ named_main_earlyfatal(const char *format, ...) {
        _exit(EXIT_FAILURE);
 }
 
-noreturn static void
+ISC_NORETURN static void
 assertion_failed(const char *file, int line, isc_assertiontype_t type,
                 const char *cond);
 
@@ -236,7 +236,7 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
        _exit(EXIT_FAILURE);
 }
 
-noreturn static void
+ISC_NORETURN static void
 library_fatal_error(const char *file, int line, const char *func,
                    const char *format, va_list args) ISC_FORMAT_PRINTF(3, 0);
 
index 7739d6b6f88ff9d96f14549bdbf4f98f6dc5c1b1..40810477620f022735b9b528bbb12f7e2af45df2 100644 (file)
@@ -426,7 +426,7 @@ const char *empty_zones[] = {
        NULL
 };
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *msg, isc_result_t result);
 
 static void
index d23b1c6732c1462fc0c24d452267866ee09eeb94..5e06051cf67f0b624600bb5163d5d7e08379791b 100644 (file)
@@ -198,7 +198,7 @@ send_update(dns_name_t *zonename, isc_sockaddr_t *primary);
 static void
 getinput(void *arg);
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 static void
index 1d35ded62b5d4c4287ae98c6512fca492fe4e15f..b11fbf47d2fadaabc459c617d4f026c5986fca0b 100644 (file)
@@ -87,7 +87,7 @@ static int32_t timeout = RNDC_TIMEOUT;
 static void
 rndc_startconnect(isc_sockaddr_t *addr);
 
-noreturn static void
+ISC_NORETURN static void
 usage(int status);
 
 static void
index 4ac83e5143338f142d8c798a4b74cc056b222359..0567ad33b1dd13c339ee516b67e76dc98d9d4505 100644 (file)
@@ -36,7 +36,7 @@ ISC_LANG_BEGINDECLS
 void
 notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
 
-noreturn void
+ISC_NORETURN void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 ISC_LANG_ENDDECLS
index cbc82c33c50d64a668de36151bf18f0c422fe3b9..9127fba967e20a538a8586faf9aeb59060ad68ad 100644 (file)
@@ -72,7 +72,7 @@ const char *program = "dnstap-read";
                }                                                     \
        } while (0)
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...);
 
 static void
index 7a5e9e3948988bf0d2b4c9ea4f03ed077269c597..3c9d9a937758497bd6ad7a10b36336bc88633045 100644 (file)
@@ -775,7 +775,7 @@ sendqueries(void *arg) {
        }
 }
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
@@ -883,7 +883,7 @@ help(void) {
               "Server ID)\n");
 }
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 
 static void
index 563c623be4d1a9f2e0cb81a26a9e3b03f2c99ebc..d06e4aee2faa1c3047a807b63548cdacfc6a284e 100644 (file)
@@ -35,7 +35,7 @@ static isc_lex_t *lex;
 
 static isc_lexspecials_t specials;
 
-noreturn static void
+ISC_NORETURN static void
 usage(void);
 
 static void
@@ -63,7 +63,7 @@ cleanup(void) {
        }
 }
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...);
 
 static void
index 9d77a10d2a535a620887a21328fb69b4f16f11ab..88a47b5acb0afc9e7fbf1ffed498c0c8435eee92 100644 (file)
@@ -36,7 +36,7 @@
 
 const char *program = "nsec3hash";
 
-noreturn static void
+ISC_NORETURN static void
 fatal(const char *format, ...);
 
 static void
index 856920226b879fbf2671a01e68e2658d29720f2c..738443a42fee083f9b20bd4cb082494fc054a17c 100644 (file)
@@ -388,10 +388,6 @@ AC_COMPILE_IFELSE(
   ],
   [AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, please fix your toolchain.])])
 
-AC_CHECK_HEADERS([stdnoreturn.h],
-                [],
-                [AC_MSG_ERROR([C11 standard headers not found, update your toolchain.])])
-
 AC_C_CONST
 AC_C_INLINE
 AC_C_VOLATILE
@@ -458,11 +454,6 @@ AC_COMPILE_IFELSE(
    AC_MSG_WARN([uname is not correctly supported])
   ])
 
-#
-# check for GCC noreturn attribute
-#
-AX_GCC_FUNC_ATTRIBUTE([noreturn])
-
 #
 # check for GCC malloc attribute
 #
index 7eafa16011ffdbb021de7873fc94acdf7ec57ffc..03e90414eb7cbc572be3471c2b6caf5fd86ff00e 100644 (file)
@@ -33,7 +33,7 @@ typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
                                        const char *);
 
 /* coverity[+kill] */
-noreturn void
+ISC_NORETURN void
 isc_assertion_failed(const char *, int, isc_assertiontype_t, const char *);
 
 void isc_assertion_setcallback(isc_assertioncallback_t);
index edb50ed8263cde876ece0630992924220828799b..eb1bb53e2ede4de75e57b87e0052dc4801a65714 100644 (file)
 #define __has_c_attribute(x) 0
 #endif /* if !defined(__has_c_attribute) */
 
-#ifdef HAVE_STDNORETURN_H
-#include <stdnoreturn.h>
-#elif HAVE_FUNC_ATTRIBUTE_NORETURN
-#define noreturn __attribute__((noreturn))
+#if __has_c_attribute(noreturn) && __STDC_VERSION__ >= 202311L
+#define ISC_NORETURN [[noreturn]]
 #else
-#define noreturn
+#define ISC_NORETURN _Noreturn
 #endif
 
 #if HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
index f4f668203f3a024b7e6f379cdd58ca85dd0233dd..fe7b5c62089fbadcfd489b795a975d909f7ff71b 100644 (file)
@@ -38,7 +38,7 @@ isc_error_unexpected(const char *, int, const char *, const char *, ...)
        ISC_FORMAT_PRINTF(4, 5);
 
 /*% fatal error */
-noreturn void
+ISC_NORETURN void
 isc_error_fatal(const char *, int, const char *, const char *, ...)
        ISC_FORMAT_PRINTF(4, 5);