From 8de5ae3552620b9273d53ae6d2d02b45217bcad0 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Jul 2024 09:55:31 +0200 Subject: [PATCH] - Fix compile when the compiler does not support the noreturn attribute. --- configure | 4 ++++ configure.ac | 2 ++ doc/Changelog | 2 ++ 3 files changed, 8 insertions(+) diff --git a/configure b/configure index 9998b36e4..6a4066771 100755 --- a/configure +++ b/configure @@ -7023,6 +7023,10 @@ printf "%s\n" "#define HAVE_ATTR_NORETURN 1" >>confdefs.h printf "%s\n" "#define ATTR_NORETURN __attribute__((__noreturn__))" >>confdefs.h +else + +printf "%s\n" "#define ATTR_NORETURN /**/" >>confdefs.h + fi diff --git a/configure.ac b/configure.ac index 6adbe0e59..977b91a24 100644 --- a/configure.ac +++ b/configure.ac @@ -360,6 +360,8 @@ AC_MSG_RESULT($ac_cv_c_noreturn_attribute) if test $ac_cv_c_noreturn_attribute = yes; then AC_DEFINE(HAVE_ATTR_NORETURN, 1, [Whether the C compiler accepts the "noreturn" attribute]) AC_DEFINE(ATTR_NORETURN, [__attribute__((__noreturn__))], [apply the noreturn attribute to a function that exits the program]) +else + AC_DEFINE(ATTR_NORETURN,[], [apply the noreturn attribute to a function that exits the program]) fi ])dnl End of CHECK_NORETURN_ATTRIBUTE diff --git a/doc/Changelog b/doc/Changelog index 221e8d02d..e9b2e7a40 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,8 @@ - Merge #1110: Make fallthrough explicit for libworker.c. - For #1110: Test for fallthrough attribute in configure and add fallthrough attribute annotations. + - Fix compile when the compiler does not support the noreturn + attribute. 19 July 2024: Wouter - Add dnstap-sample-rate that logs only 1/N messages, for high volume