Clang 20 is complaining about passing NULL to an argument with 'nonnull'
attribute. Mark these two functions with the same attribute to assure
that these two function also don't accept NULL as an argument.
(cherry picked from commit
9e350c177403ead4c8a6630a08f36f304b04484c)
dns_db_detach(&db);
}
+static void
+print_time(FILE *fp) ISC_ATTR_NONNULL(1);
static void
print_time(FILE *fp) {
time_t currenttime = time(NULL);
fprintf(fp, "; File written on %s\n", timebuf);
}
+static void
+print_version(FILE *fp) ISC_ATTR_NONNULL(1);
static void
print_version(FILE *fp) {
if (outputformat != dns_masterformat_text) {
fatal("failed to open temporary output file: %s",
isc_result_totext(result));
}
+ INSIST(outfp != NULL);
removefile = true;
setfatalcallback(&removetempfile);
}
#endif /* HAVE_FUNC_ATTRIBUTE_MALLOC */
#define ISC_ATTR_UNUSED __attribute__((__unused__))
+
+#if __has_attribute(__nonnull__)
+#define ISC_ATTR_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
+#else
+#define ISC_ATTR_NONNULL(...)
+#endif