diff options
author | Shawn Routhier <sar@isc.org> | 2012-02-16 22:07:04 +0000 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2012-02-16 22:07:04 +0000 |
commit | e3c948003ba79f75f9bd7ae0efb5488664f44475 (patch) | |
tree | d178ad770588d2ab0680fd631f4cb43b2dc7677e | |
parent | b36ed9c3f25deeab5732de1852583e3a2831b4d7 (diff) | |
download | isc-dhcp-e3c948003ba79f75f9bd7ae0efb5488664f44475.tar.gz |
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]
-rw-r--r-- | RELNOTES | 5 | ||||
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | includes/omapip/omapip_p.h | 2 |
3 files changed, 19 insertions, 2 deletions
@@ -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 diff --git a/configure.ac b/configure.ac index 475aefb7..8ebedac5 100644 --- a/configure.ac +++ b/configure.ac @@ -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__ diff --git a/includes/omapip/omapip_p.h b/includes/omapip/omapip_p.h index 8671d489..847f764c 100644 --- a/includes/omapip/omapip_p.h +++ b/includes/omapip/omapip_p.h @@ -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 *, ...) |