]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add a compile time check for the presence of the noreturn attribute
authorShawn Routhier <sar@isc.org>
Thu, 16 Feb 2012 22:07:04 +0000 (22:07 +0000)
committerShawn Routhier <sar@isc.org>
Thu, 16 Feb 2012 22:07:04 +0000 (22:07 +0000)
and use it for log_fatal if it's available.  This will help code
checking programs to eliminate false positives.
[ISC-Bugs 27539]

RELNOTES
configure.ac
includes/omapip/omapip_p.h

index 0fe9b756919165fdccf0b0f049d47ee4cc7cb3f2..e0e7d604d82a28cf91328bc61111b46d3d848567 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -89,6 +89,11 @@ work on other platforms. Please report any problems and suggested fixes to
   support for Infiniband in the future.  This patch also corrects
   some issues we found in the socket code.  [ISC-Bugs #24245]
 
+- Add a compile time check for the presence of the noreturn attribute
+  and use it for log_fatal if it's available.  This will help code
+  checking programs to eliminate false positives.
+  [ISC-Bugs 27539]
+
                        Changes since 4.2.2
 
 - Fix the code that checks for an existing DDNS transaction to cancel
index 475aefb7f5579551e6e88087e66f66b711ac77ee..8ebedac5e6c3cea38cd916da128a1cf0531075ce 100644 (file)
@@ -453,6 +453,18 @@ AC_TRY_LINK(
                   [Define to 1 if the system has 'struct if_laddrreq'.])],
        [AC_MSG_RESULT(no)])
 
+#
+# check for GCC noreturn attribute
+#
+AC_MSG_CHECKING(for GCC noreturn attribute)
+AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
+       [AC_MSG_RESULT(yes)
+        AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))],
+                  [Define to the string for a noreturn attribute.])],
+       [AC_MSG_RESULT(no)
+        AC_DEFINE([ISC_DHCP_NORETURN], [],
+                  [Define to the string for a noreturn attribute.])])
+
 # Look for optional headers.
 AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
 
@@ -488,7 +500,7 @@ AC_CHECK_SIZEOF(struct iaddr *, , [
 #include <stdio.h>
 ])
 
-# Solaris does not have the msg_control or msg_controlen members in 
+# Solaris does not have the msg_control or msg_controlen members 
 # in the msghdr structure unless you define:
 #
 #   _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
index 8671d489614a2b0fbaffab03d49b439d2940eab8..847f764c2d574fcc27a42ab7ac209f75e5968e22 100644 (file)
@@ -289,7 +289,7 @@ extern int log_perror;
 extern void (*log_cleanup) (void);
 
 void log_fatal (const char *, ...)
-       __attribute__((__format__(__printf__,1,2)));
+       __attribute__((__format__(__printf__,1,2))) ISC_DHCP_NORETURN;
 int log_error (const char *, ...)
        __attribute__((__format__(__printf__,1,2)));
 int log_info (const char *, ...)