if (lookup->ecs_addr != NULL) {
uint8_t addr[16];
- uint16_t family;
+ uint16_t family = 0;
uint32_t plen;
struct sockaddr *sa;
struct sockaddr_in *sin;
catz_chgzone_event_t *event;
isc_task_t *task;
isc_result_t result;
- isc_taskaction_t action;
+ isc_taskaction_t action = NULL;
switch (type) {
case DNS_EVENT_CATZADDZONE:
obj2 = cfg_tuple_get(obj, "response");
if (!cfg_obj_isvoid(obj2)) {
const char *resp = cfg_obj_asstring(obj2);
- isc_result_t r;
+ isc_result_t r = DNS_R_SERVFAIL;
if (strcasecmp(resp, "drop") == 0)
r = DNS_R_DROP;
obj2 = cfg_tuple_get(obj, "response");
if (!cfg_obj_isvoid(obj2)) {
const char *resp = cfg_obj_asstring(obj2);
- isc_result_t r;
+ isc_result_t r = DNS_R_SERVFAIL;
if (strcasecmp(resp, "drop") == 0)
r = DNS_R_DROP;
const char *empty_dbtype[4] =
{ "_builtin", "empty", NULL, NULL };
int empty_dbtypec = 4;
- dns_zonestat_level_t statlevel;
+ dns_zonestat_level_t statlevel = dns_zonestat_none;
name = dns_fixedname_initname(&fixed);
named_server_reload(isc_task_t *task, isc_event_t *event) {
named_server_t *server = (named_server_t *)event->ev_arg;
- INSIST(task = server->task);
+ INSIST(task == server->task);
UNUSED(task);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
const char *viewname = NULL;
dns_rdataclass_t rdclass;
dns_view_t *view = NULL;
- const char *bn;
+ const char *bn = NULL;
REQUIRE(viewp != NULL && *viewp == NULL);
REQUIRE(zoneobjp != NULL && *zoneobjp == NULL);
const dns_master_style_t *masterstyle = &dns_master_style_default;
isc_stats_t *zoneqrystats;
dns_stats_t *rcvquerystats;
- dns_zonestat_level_t statlevel;
+ dns_zonestat_level_t statlevel = dns_zonestat_none;
int seconds;
dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
isc_dscp_t dscp;
}
#ifdef USE_DNSRPS
printf("%s\n", librpz->dnsrpzd_path);
- return (0);
#else
INSIST(0);
+ ISC_UNREACHABLE();
#endif
+ return (0);
case 'n':
if (!link_dnsrps(&emsg)) {
librpz->rsp_detach(&rsp);
librpz->client_detach(&client);
printf("%u\n", serial);
- return (0);
#else
INSIST(0);
+ ISC_UNREACHABLE();
#endif
+ return (0);
case 'w':
seconds = strtod(optarg, &p);
/* Define to 1 if the compiler supports __builtin_expect. */
#undef HAVE_BUILTIN_EXPECT
+/* define if the compiler supports __builtin_unreachable(). */
+#undef HAVE_BUILTIN_UNREACHABLE
+
/* Define to 1 if you have the `catgets' function. */
#undef HAVE_CATGETS
done
+#
+# Check for __builtin_unreachable
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler support for __builtin_unreachable()" >&5
+$as_echo_n "checking compiler support for __builtin_unreachable()... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+__builtin_unreachable();
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BUILTIN_UNREACHABLE 1" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
#
# Check for __builtin_expect
#
AC_CHECK_HEADERS([uchar.h])
+#
+# Check for __builtin_unreachable
+#
+AC_MSG_CHECKING([compiler support for __builtin_unreachable()])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[]],
+ [[__builtin_unreachable();]]
+ )],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().])
+ ],
+ [AC_MSG_RESULT([no])
+ ])
+
#
# Check for __builtin_expect
#
return (DNSTAP__MESSAGE__TYPE__UPDATE_RESPONSE);
default:
INSIST(0);
+ ISC_UNREACHABLE();
}
}
int i;
INSIST(DNS_IPTABLE_VALID(tab));
- INSIST(tab->radix);
+ INSIST(tab->radix != NULL);
NETADDR_TO_PREFIX_T(addr, pfx, bitlen);
lctx->format = format;
switch (format) {
- default:
- INSIST(0);
case dns_masterformat_text:
lctx->openfile = openfile_text;
lctx->load = load_text;
lctx->openfile = openfile_map;
lctx->load = load_map;
break;
+ default:
+ INSIST(0);
+ ISC_UNREACHABLE();
}
if (lex != NULL) {
const dns_rpz_cidr_key_t *tgt_ip, dns_rpz_prefix_t tgt_prefix,
bool inc)
{
- dns_rpz_trigger_counter_t *cnt;
- dns_rpz_zbits_t *have;
+ dns_rpz_trigger_counter_t *cnt = 0;
+ dns_rpz_zbits_t *have = 0;
switch (rpz_type) {
case DNS_RPZ_TYPE_CLIENT_IP:
break;
default:
INSIST(0);
+ ISC_UNREACHABLE();
}
if (inc) {
dns_rpz_addr_zbits_t tgt_set;
dns_rpz_cidr_node_t *found;
isc_result_t result;
- dns_rpz_num_t rpz_num;
+ dns_rpz_num_t rpz_num = 0;
dns_rpz_have_t have;
int i;
*/
#include <isc/likely.h>
+#ifdef HAVE_BUILTIN_UNREACHABLE
+#define ISC_UNREACHABLE() __builtin_unreachable();
+#else
+#define ISC_UNREACHABLE()
+#endif
+
#ifdef UNIT_TESTING
extern void mock_assert(const int result, const char* const expression,
const char * const file, const int line);
break;
}
INSIST(0);
+ ISC_UNREACHABLE();
}
CK_ATTRIBUTE *
int i;
uint32_t r;
- REQUIRE(buf);
+ REQUIRE(buf != NULL);
REQUIRE(buflen > 0);
RUNTIME_CHECK(isc_once_do(&isc_random_once,
isc_buffer_t buf;
uint8_t addr[16];
uint32_t plen, addrl;
- uint16_t family;
+ uint16_t family = 0;
/* Add CLIENT-SUBNET option. */
dns_rdatatype_t ip_type, dns_rpz_type_t rpz_type)
{
dns_rpz_st_t *st;
- dns_rpz_zbits_t zbits;
+ dns_rpz_zbits_t zbits = 0;
REQUIRE(client != NULL);
REQUIRE(client->query.rpz_st != NULL);