Commit debd489a authored by Francis Dupont's avatar Francis Dupont
Browse files

noreturn RT #20257

parent 1e733ffc
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.
......
......@@ -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] "
......
......@@ -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,
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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
......
......@@ -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);
......
......@@ -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(
......
......@@ -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);
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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);
......
......@@ -15,15 +15,16 @@
* 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);
......
......@@ -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,
......
......@@ -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);
......
......@@ -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);
......
......@@ -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, "\
......
......@@ -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
......
......@@ -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;
......
......@@ -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
#
......
......@@ -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 { \
......
......@@ -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");
......
......@@ -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");
......
......@@ -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>
......@@ -57,8 +57,11 @@
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);
......
......@@ -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] "
......
......@@ -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] "