#
AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
+#
+# check for GCC returns_nonnull attribute
+#
+AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
+
#
# how to link math functions?
#
* it is undefined and falls back to the default value of 'width'
*/
+ISC_ATTR_WARN_UNUSED_RESULT
isc_result_t
dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
dns_rdatatype_t type, void *source, isc_buffer_t *target);
#define ISC_ATTR_RETURNS_NONNULL
#endif
+#if HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
+#define ISC_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define ISC_ATTR_WARN_UNUSED_RESULT
+#endif
+
#ifdef HAVE_FUNC_ATTRIBUTE_MALLOC
/*
* Indicates that a function is malloc-like, i.e., that the
static void
make_nsec3(nsec3_testcase_t *testcase, dns_rdata_t *private,
unsigned char *pbuf) {
+ isc_result_t result;
dns_rdata_nsec3param_t params;
dns_rdata_t nsec3param = DNS_RDATA_INIT;
unsigned char bufdata[BUFSIZ];
}
isc_buffer_init(&buf, bufdata, sizeof(bufdata));
- dns_rdata_fromstruct(&nsec3param, dns_rdataclass_in,
- dns_rdatatype_nsec3param, ¶ms, &buf);
+ result = dns_rdata_fromstruct(&nsec3param, dns_rdataclass_in,
+ dns_rdatatype_nsec3param, ¶ms, &buf);
+ assert_int_equal(result, ISC_R_SUCCESS);
dns_rdata_init(private);