]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
noreturn RT #20257
authorFrancis Dupont <fdupont@isc.org>
Tue, 29 Sep 2009 15:06:07 +0000 (15:06 +0000)
committerFrancis Dupont <fdupont@isc.org>
Tue, 29 Sep 2009 15:06:07 +0000 (15:06 +0000)
37 files changed:
CHANGES
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/confgen/ddns-confgen.c
bin/confgen/rndc-confgen.c
bin/confgen/util.h
bin/dig/dig.c
bin/dig/host.c
bin/dig/include/dig/dig.h
bin/dnssec/dnssec-dsfromkey.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/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/nsec3hash.c
configure.in
lib/dns/include/dns/rbt.h
lib/export/samples/nsprobe.c
lib/export/samples/sample-async.c
lib/export/samples/sample-request.c
lib/export/samples/sample-update.c
lib/export/samples/sample.c
lib/isc/assertions.c
lib/isc/include/isc/assertions.h
lib/isc/include/isc/error.h
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/refcount.h
lib/isc/win32/include/isc/platform.h
lib/isc/win32/libisc.def

diff --git a/CHANGES b/CHANGES
index 62018c56ddd54c6ae1fef706bfc1709d4fb2bd03..44304cf0625dfa00d985105cfb337d99735c50d4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
-2792.  [port]          win32: 32/64 bit cleanups. [RT #128244]
+2793.  [port]          Add some noreturn attributes. [RT #20257]
+
+2792.  [port]          win32: 32/64 bit cleanups. [RT #20335]
 
 2691.  [func]          dnssec-signzone: retain the existing NSEC or NSEC3
                        chain when re-signing a previously-signed zone.
index 51c40704e9ecda2be32aa91d6355ffb6ce77a3ae..3ef766cc84dc54a6cd81471abbe31d7015c23919 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named-checkconf.c,v 1.49 2009/07/13 06:57:21 marka Exp $ */
+/* $Id: named-checkconf.c,v 1.50 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -59,6 +59,9 @@ isc_log_t *logc = NULL;
        } while (0)
 
 /*% usage */
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "usage: %s [-h] [-j] [-v] [-z] [-t directory] "
index 88f3347480983c9056e72c45e0781b68c3597c3d..c36152b3e92a84fc9b56b0ebe415636a5350532c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named-checkzone.c,v 1.54 2009/05/29 02:14:31 marka Exp $ */
+/* $Id: named-checkzone.c,v 1.55 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -70,6 +70,9 @@ static enum { progmode_check, progmode_compile } progmode;
                } \
        } while (0)
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr,
index c2ec61e1dcf32fe76a8ef2b92ddd511fe883364a..44f9c27dfc6b194b397286f439c098686b7716cb 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: ddns-confgen.c,v 1.8 2009/07/29 17:52:00 each Exp $ */
+/* $Id: ddns-confgen.c,v 1.9 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -60,6 +60,9 @@ const char *progname;
 
 isc_boolean_t verbose = ISC_FALSE;
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(int status) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(int status) {
 
index 33647eea1ee11ae9a61502cf175911c73a79ef04..cea8cc7da7215cf98414179b1fb92413ad105e11 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc-confgen.c,v 1.4 2009/06/15 23:47:59 tbox Exp $ */
+/* $Id: rndc-confgen.c,v 1.5 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -69,6 +69,9 @@ isc_boolean_t verbose = ISC_FALSE;
 
 const char *keyfile, *keydef;
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(int status) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(int status) {
 
index 89a09d7ca7fc4fe8cd74f1d4461e4fdb409477df..f3b2ec9dee18d5b2c412a9daad09ed697513f5ca 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: util.h,v 1.3 2009/06/11 23:47:55 tbox Exp $ */
+/* $Id: util.h,v 1.4 2009/09/29 15:06:05 fdupont Exp $ */
 
 #ifndef RNDC_UTIL_H
 #define RNDC_UTIL_H 1
@@ -22,6 +22,7 @@
 /*! \file */
 
 #include <isc/lang.h>
+#include <isc/platform.h>
 
 #include <isc/formatcheck.h>
 
@@ -42,8 +43,9 @@ ISC_LANG_BEGINDECLS
 void
 notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
 
-void
-fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+ISC_PLATFORM_NORETURN_PRE void
+fatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 ISC_LANG_ENDDECLS
 
index 66e76e4f98080c16b70b07dac977ca8c3a8d9971..884cc95388ab0b9f7e7296d3bb4c70e7df55948f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dig.c,v 1.231 2009/09/23 06:21:36 each Exp $ */
+/* $Id: dig.c,v 1.232 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -138,6 +138,9 @@ print_usage(FILE *fp) {
 "            [ host [@local-server] {local-d-opt} [...]]\n", fp);
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        print_usage(stderr);
index a278a3df81bc54c87adf9cd401e2dc848ccae516..6a00cfce32b1e18bb75a0db8808321caf11d2af1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: host.c,v 1.119 2009/09/08 23:23:22 marka Exp $ */
+/* $Id: host.c,v 1.120 2009/09/29 15:06:05 fdupont Exp $ */
 
 /*! \file */
 
@@ -141,6 +141,9 @@ rcode_totext(dns_rcode_t rcode)
        return totext.deconsttext;
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+show_usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 show_usage(void) {
        fputs(
index d463afb35f71a2fb883f8fea7dd8ec54abfe4bce..5ac1d30e600ac6cea4a18c9fb0a4634db2606b87 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dig.h,v 1.110 2009/09/15 23:48:09 tbox Exp $ */
+/* $Id: dig.h,v 1.111 2009/09/29 15:06:06 fdupont Exp $ */
 
 #ifndef DIG_H
 #define DIG_H
@@ -292,8 +292,9 @@ isc_result_t
 get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
            isc_boolean_t strict);
 
-void
-fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+ISC_PLATFORM_NORETURN_PRE void
+fatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 void
 debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
index 9b1b55a8b7e1455d39bbb39530cce5c769dc7fb6..9a89b5696532d13921a03207c635e56d7970f79a 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-dsfromkey.c,v 1.13 2009/09/01 00:22:24 jinmei Exp $ */
+/* $Id: dnssec-dsfromkey.c,v 1.14 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -282,6 +282,9 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
        putchar('\n');
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index 8baa19870b5ab730e30a9fe4a13eee9d63a25fd8..370b02a5e94be739253ba869c790057e9b91f69f 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-keyfromlabel.c,v 1.15 2009/09/23 16:01:56 each Exp $ */
+/* $Id: dnssec-keyfromlabel.c,v 1.16 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -51,6 +51,9 @@ int verbose;
 static const char *algs = "RSA | RSAMD5 | DH | DSA | RSASHA1 |"
                          " NSEC3DSA | NSEC3RSASHA1";
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index 5cdf108e2b87546c6aae223d06623152326e7516..86d8bbdee139517106e27a861f92db1ba644cc6d 100644 (file)
@@ -29,7 +29,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-keygen.c,v 1.96 2009/09/23 16:01:56 each Exp $ */
+/* $Id: dnssec-keygen.c,v 1.97 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -73,6 +73,9 @@ dsa_size_ok(int size) {
        return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index 2b484ad9ebc4eb69f9090d9985af3a681a1fcf5c..7f2f6d301cb4c24a44c9b297c7fbd8789e974b81 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-revoke.c,v 1.12 2009/09/23 16:01:56 each Exp $ */
+/* $Id: dnssec-revoke.c,v 1.13 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -46,6 +46,9 @@ int verbose;
 
 static isc_mem_t       *mctx = NULL;
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index 848ac1550b77a997e53d4a53a739fba8eebbb1c9..ff323c337d57fca08b8644734f2754d80aada943 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-settime.c,v 1.13 2009/09/23 16:01:56 each Exp $ */
+/* $Id: dnssec-settime.c,v 1.14 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -48,6 +48,9 @@ int verbose;
 
 static isc_mem_t       *mctx = NULL;
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index 3672947037d438c223d55157bf0d2cefbb9efa48..4e9ed949832527b7044d5831634bba7fee6ea1ac 100644 (file)
@@ -29,7 +29,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signzone.c,v 1.237 2009/09/25 23:48:10 tbox Exp $ */
+/* $Id: dnssec-signzone.c,v 1.238 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -3273,6 +3273,9 @@ print_version(FILE *fp) {
        fprintf(fp, "; dnssec_signzone version " VERSION "\n");
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(void) {
        fprintf(stderr, "Usage:\n");
index df714e703b08d8c9d02eae83cfcb6d623614aa7b..40213bcfd850594ef9465eedb8bf5d64e9e1e29a 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssectool.h,v 1.25 2009/09/04 02:31:29 marka Exp $ */
+/* $Id: dnssectool.h,v 1.26 2009/09/29 15:06:06 fdupont Exp $ */
 
 #ifndef DNSSECTOOL_H
 #define DNSSECTOOL_H 1
@@ -27,8 +27,9 @@
 
 typedef void (fatalcallback_t)(void);
 
-void
-fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+ISC_PLATFORM_NORETURN_PRE void
+fatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 void
 setfatalcallback(fatalcallback_t *callback);
index e83453946795aefe3e8c0d5bd6828d67d2f183f6..d91dd39871f91904fe137c30ac0a63416e460805 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.h,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: main.h,v 1.16 2009/09/29 15:06:06 fdupont Exp $ */
 
 #ifndef NAMED_MAIN_H
 #define NAMED_MAIN_H 1
 
 /*! \file */
 
-void
-ns_main_earlyfatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+ISC_PLATFORM_NORETURN_PRE void
+ns_main_earlyfatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 void
 ns_main_earlywarning(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
index b0f051413334e541eda28a3a0cc2b2f943666e6c..c6a640dd959f1d16fcfea7eeb43db44e4f5bd859 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.c,v 1.173 2009/09/01 18:40:25 jinmei Exp $ */
+/* $Id: main.c,v 1.174 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -138,6 +138,10 @@ ns_main_earlyfatal(const char *format, ...) {
        exit(1);
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+assertion_failed(const char *file, int line, isc_assertiontype_t type,
+                const char *cond) ISC_PLATFORM_NORETURN_POST;
+
 static void
 assertion_failed(const char *file, int line, isc_assertiontype_t type,
                 const char *cond)
@@ -207,9 +211,10 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
        exit(1);
 }
 
-static void
+ISC_PLATFORM_NORETURN_PRE static void
 library_fatal_error(const char *file, int line, const char *format,
-                   va_list args) ISC_FORMAT_PRINTF(3, 0);
+                   va_list args)
+ISC_FORMAT_PRINTF(3, 0) ISC_PLATFORM_NORETURN_POST;
 
 static void
 library_fatal_error(const char *file, int line, const char *format,
index 4258ee9dcc49d3f32fc8f5ac9a7650a315c23370..4f81a99361f66309dcc10d5c9d8612e9e089bfa5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.548 2009/09/10 01:49:29 each Exp $ */
+/* $Id: server.c,v 1.549 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -243,8 +243,8 @@ static const struct {
        { NULL, ISC_FALSE }
 };
 
-static void
-fatal(const char *msg, isc_result_t result);
+ISC_PLATFORM_NORETURN_PRE static void
+fatal(const char *msg, isc_result_t result) ISC_PLATFORM_NORETURN_POST;
 
 static void
 ns_server_reload(isc_task_t *task, isc_event_t *event);
index c62a8418bfdec2c21f9e1dbdb94923404bbe2122..a24590ad549570a9141df881d6506053826d0a4e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.172 2009/09/01 00:22:25 jinmei Exp $ */
+/* $Id: nsupdate.c,v 1.173 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -181,8 +181,10 @@ typedef struct nsu_requestinfo {
 static void
 sendrequest(isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
            dns_message_t *msg, dns_request_t **request);
-static void
-fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+
+ISC_PLATFORM_NORETURN_PRE static void
+fatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 static void
 debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
index 532ce901f730150237d3162cab9f9da2a1586c30..6ea6355606f5fac5ac3ad0972735c305b45bd045 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc.c,v 1.125 2009/05/04 17:38:56 jreed Exp $ */
+/* $Id: rndc.c,v 1.126 2009/09/29 15:06:06 fdupont Exp $ */
 
 /*! \file */
 
@@ -90,6 +90,9 @@ static isc_uint32_t serial;
 
 static void rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task);
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(int status) ISC_PLATFORM_NORETURN_POST;
+
 static void
 usage(int status) {
        fprintf(stderr, "\
index 7adcaa5bfacca594e85fa947c42faba895bdb6c7..14b011ba52d1e3e43f3330cdae3cd811da722e77 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: util.h,v 1.10 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: util.h,v 1.11 2009/09/29 15:06:06 fdupont Exp $ */
 
 #ifndef RNDC_UTIL_H
 #define RNDC_UTIL_H 1
@@ -23,6 +23,7 @@
 /*! \file */
 
 #include <isc/lang.h>
+#include <isc/platform.h>
 
 #include <isc/formatcheck.h>
 
@@ -43,8 +44,9 @@ ISC_LANG_BEGINDECLS
 void
 notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
 
-void            
-fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
+ISC_PLATFORM_NORETURN_PRE void            
+fatal(const char *format, ...)
+ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
 
 ISC_LANG_ENDDECLS
 
index 65bddf6fec9de28fba9d944d3686ff13e78eeae6..13702674eb78fb72de4516fd82e49c54da742419 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsec3hash.c,v 1.4 2009/03/07 23:47:45 tbox Exp $ */
+/* $Id: nsec3hash.c,v 1.5 2009/09/29 15:06:06 fdupont Exp $ */
 
 #include <config.h>
 
@@ -36,6 +36,9 @@
 
 const char *program = "nsec3hash";
 
+ISC_PLATFORM_NORETURN_PRE static void
+fatal(const char *format, ...) ISC_PLATFORM_NORETURN_POST;
+
 static void
 fatal(const char *format, ...) {
        va_list args;
index 6a2741ff3e4141818f6eac09ba3c6bc95a183bea..73c44779356c411bc014e943d14a7075faacffd4 100644 (file)
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.479 $)
+AC_REVISION($Revision: 1.480 $)
 
 AC_INIT(lib/dns/name.c)
 AC_PREREQ(2.59)
@@ -338,6 +338,20 @@ AC_TRY_COMPILE([],[long long i = 0; return (0);],
                ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
 
+#
+# check for GCC noreturn attribute
+#
+AC_MSG_CHECKING(for GCC noreturn attribute)
+AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
+       [AC_MSG_RESULT(yes)
+               ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
+               ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
+       [AC_MSG_RESULT(no)
+               ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
+               ISC_PLATFORM_NORETURN="#define ISC_PLATFORM_NORETURN_POST"])
+AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
+AC_SUBST(ISC_PLATFORM_NORETURN_POST)
+
 #
 # check if we have lifconf
 #
index bd11f40b13b84469eb7fea82e1ba73ae0b90b405..a33bda4d34b7db885dc61d06eb489e7f1576c46c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbt.h,v 1.73 2009/01/17 23:47:43 tbox Exp $ */
+/* $Id: rbt.h,v 1.74 2009/09/29 15:06:06 fdupont Exp $ */
 
 #ifndef DNS_RBT_H
 #define DNS_RBT_H 1
@@ -909,7 +909,7 @@ dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name);
        } while (0)
 #else  /* DNS_RBT_USEISCREFCOUNT */
 #define dns_rbtnode_refinit(node, n)    ((node)->references = (n))
-#define dns_rbtnode_refdestroy(node)    (REQUIRE((node)->references == 0))
+#define dns_rbtnode_refdestroy(node)    REQUIRE((node)->references == 0)
 #define dns_rbtnode_refcurrent(node)    ((node)->references)
 #define dns_rbtnode_refincrement0(node, refs)                   \
        do {                                                    \
index e706e2902373d557825a81572d406debd9c23547..1fc364c9d057a7345bdd375e9241aa0e75125965 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsprobe.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: nsprobe.c,v 1.5 2009/09/29 15:06:06 fdupont Exp $ */
 
 #include <config.h>
 
@@ -1015,8 +1015,11 @@ probe_domain(struct probe_trans *trans) {
        return (result);
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
-usage() {
+usage(void) {
        fprintf(stderr, "usage: nsprobe [-d] [-v [-v...]] [-c cache_address] "
                "[input_file]\n");
 
index 014b6a65d0550030c7d7441741021c4578347bda..e646e795e9ae7d03dc6d69dbecc317e102e4dacb 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sample-async.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: sample-async.c,v 1.5 2009/09/29 15:06:07 fdupont Exp $ */
 
 #include <config.h>
 
@@ -247,8 +247,11 @@ dispatch_query(struct query_trans *trans) {
        return (result);
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
-usage() {
+usage(void) {
        fprintf(stderr, "usage: sample-async [-s server_address] [-t RR type] "
                "input_file\n");
 
index 4d7d2fc9ef1f7b70a176cbc39f095a55708fcd40..d5d2312e30d13e66a28f8039ca768de167e947d2 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sample-request.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: sample-request.c,v 1.5 2009/09/29 15:06:07 fdupont Exp $ */
 
 #include <config.h>
 
 static isc_mem_t *mctx;
 static dns_fixedname_t fixedqname;
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
-usage() {
+usage(void) {
        fprintf(stderr, "sample-request [-t RRtype] server_address hostname\n");
 
        exit(1);
index c614e77c6e83c039af040949e112e963a94c405d..7357106e7fb8a2dcd9ae1ac3aebaae0df65a71a3 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sample-update.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: sample-update.c,v 1.5 2009/09/29 15:06:07 fdupont Exp $ */
 
 #include <config.h>
 
@@ -67,8 +67,11 @@ static void update_addordelete(isc_mem_t *mctx, char *cmdline,
                               isc_boolean_t isdelete, dns_name_t *name);
 static void evaluate_prereq(isc_mem_t *mctx, char *cmdline, dns_name_t *name);
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
-usage() {
+usage(void) {
        fprintf(stderr, "sample-update "
                "[-a auth_server] "
                "[-k keyfile] "
index f547e893e907efe97e59fcd7d164dd0303c12995..7fc6a303ffa9848f8f3daf28db4b8cb863f0b915 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sample.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: sample.c,v 1.5 2009/09/29 15:06:07 fdupont Exp $ */
 
 #include <config.h>
 
@@ -78,8 +78,11 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner) {
        return (ISC_R_SUCCESS);
 }
 
+ISC_PLATFORM_NORETURN_PRE static void
+usage(void) ISC_PLATFORM_NORETURN_POST;
+
 static void
-usage() {
+usage(void) {
        fprintf(stderr, "sample [-t RRtype] "
                "[[-a algorithm] [-e] -k keyname -K keystring] "
                "[-s domain:serveraddr_for_domain ] "
index 368e90052c7b539e1503102f2c38a5489a07aae4..31c4fe7c9f273a2d109e43cd2fce2c9ae97aa3b7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: assertions.c,v 1.25 2009/09/02 23:48:02 tbox Exp $ */
+/* $Id: assertions.c,v 1.26 2009/09/29 15:06:07 fdupont Exp $ */
 
 /*! \file */
 
 /*%
  * Forward.
  */
-/* coverity[+kill] */
 static void
 default_callback(const char *, int, isc_assertiontype_t, const char *);
 
+static isc_assertioncallback_t isc_assertion_failed_cb = default_callback;
+
 /*%
  * Public.
  */
 
-LIBISC_EXTERNAL_DATA isc_assertioncallback_t isc_assertion_failed =
-                                            default_callback;
+/*% assertion failed handler */
+/* coverity[+kill] */
+void
+isc_assertion_failed(const char *file, int line, isc_assertiontype_t type,
+                    const char *cond)
+{
+       isc_assertion_failed_cb(file, line, type, cond);
+       abort();
+       /* NOTREACHED */
+}
 
 /*% Set callback. */
 void
 isc_assertion_setcallback(isc_assertioncallback_t cb) {
        if (cb == NULL)
-               isc_assertion_failed = default_callback;
+               isc_assertion_failed_cb = default_callback;
        else
-               isc_assertion_failed = cb;
+               isc_assertion_failed_cb = cb;
 }
 
 /*% Type to Text */
@@ -127,6 +136,4 @@ default_callback(const char *file, int line, isc_assertiontype_t type,
                }
        }
        fflush(stderr);
-       abort();
-       /* NOTREACHED */
 }
index b03115216909b8f9d8bcfed5b3327173ad91fa22..26d3fa1dbe715662cec90d7492b90e53b543a4aa 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: assertions.h,v 1.26 2008/10/15 23:47:31 tbox Exp $
+ * $Id: assertions.h,v 1.27 2009/09/29 15:06:07 fdupont Exp $
  */
 /*! \file isc/assertions.h
  */
@@ -41,7 +41,9 @@ typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
                                        const char *);
 
 /* coverity[+kill] */
-LIBISC_EXTERNAL_DATA extern isc_assertioncallback_t isc_assertion_failed;
+ISC_PLATFORM_NORETURN_PRE
+void isc_assertion_failed(const char *, int, isc_assertiontype_t,
+                         const char *) ISC_PLATFORM_NORETURN_POST;
 
 void
 isc_assertion_setcallback(isc_assertioncallback_t);
index efb9b5f3a11c1bf0108f1044fa5dddea5bf77b5d..160b549b1eb70e31735c8c4adb73bc80dd72cf31 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: error.h,v 1.20 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: error.h,v 1.21 2009/09/29 15:06:07 fdupont Exp $ */
 
 #ifndef ISC_ERROR_H
 #define ISC_ERROR_H 1
@@ -26,6 +26,7 @@
 
 #include <isc/formatcheck.h>
 #include <isc/lang.h>
+#include <isc/platform.h>
 
 ISC_LANG_BEGINDECLS
 
@@ -45,9 +46,9 @@ isc_error_unexpected(const char *, int, const char *, ...)
      ISC_FORMAT_PRINTF(3, 4);
 
 /*% fatal error */
-void
+ISC_PLATFORM_NORETURN_PRE void
 isc_error_fatal(const char *, int, const char *, ...)
-     ISC_FORMAT_PRINTF(3, 4);
+ISC_FORMAT_PRINTF(3, 4) ISC_PLATFORM_NORETURN_POST;
 
 /*% runtimecheck error */
 void
index ef49d3298d0d10212c7f60c3fe541c3a53652c88..eb2ff0bfad8f6a76e6759ccf7c04e784708278f5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: platform.h.in,v 1.52 2009/09/01 18:40:25 jinmei Exp $ */
+/* $Id: platform.h.in,v 1.53 2009/09/29 15:06:07 fdupont Exp $ */
 
 #ifndef ISC_PLATFORM_H
 #define ISC_PLATFORM_H 1
  */
 @ISC_PLATFORM_OPENSSLHASH@
 
+/*
+ * Defines for the noreturn attribute.
+ */
+@ISC_PLATFORM_NORETURN_PRE@
+@ISC_PLATFORM_NORETURN_POST@
+
 /***
  ***   Windows dll support.
  ***/
index 6ab14ae732c3db1d79c5a39af9eb975140f3c57f..98086b71a8ce2cf90b995f8270b409c39a224af9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: refcount.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: refcount.h,v 1.16 2009/09/29 15:06:07 fdupont Exp $ */
 
 #ifndef ISC_REFCOUNT_H
 #define ISC_REFCOUNT_H 1
@@ -103,7 +103,7 @@ typedef struct isc_refcount {
        isc_int32_t refs;
 } isc_refcount_t;
 
-#define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0))
+#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0)
 #define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
 
 #define isc_refcount_increment0(rp, tp)                                \
@@ -192,7 +192,7 @@ typedef struct isc_refcount {
        int refs;
 } isc_refcount_t;
 
-#define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0))
+#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0)
 #define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
 
 #define isc_refcount_increment0(rp, tp)                                        \
index 3e23fe2b870fe7896f07f79c94958bd42721d929..b9c0c26d508fd98e02df06f93d3ec272555fa8d9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: platform.h,v 1.17 2008/12/01 03:51:47 marka Exp $ */
+/* $Id: platform.h,v 1.18 2009/09/29 15:06:07 fdupont Exp $ */
 
 #ifndef ISC_PLATFORM_H
 #define ISC_PLATFORM_H 1
  */
 #undef ISC_PLATFORM_HAVESYSUNH
 
+/*
+ * Defines for the noreturn attribute.
+ */
+#define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn)
+#define ISC_PLATFORM_NORETURN_POST
+
  /*
  * Set up a macro for importing and exporting from the DLL
  */
index 4133c419c6efeeaa8290e820adf9dc7516c42b54..c1eebe4011cc037fa118f3387fd2fcdea1f0709c 100644 (file)
@@ -48,6 +48,7 @@ isc__app_run
 isc__app_shutdown
 isc__app_start
 isc__app_unblock
+isc_assertion_failed
 isc_assertion_setcallback
 isc_assertion_typetotext
 isc_backtrace_getsymbol
@@ -552,7 +553,6 @@ syslog
 
 EXPORTS
 
-isc_assertion_failed           DATA
 isc_commandline_argument       DATA
 isc_commandline_errprint       DATA
 isc_commandline_index          DATA