From 49e62ee1861b4f7fdf1be4ed50c7b0bef9d629f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Mercan?= Date: Fri, 17 May 2024 16:45:10 +0300 Subject: [PATCH 1/2] fix typing mistakes in trace macros The detach function declaration in `ISC__REFCOUNT_TRACE_DECL` had an returned an accidental implicit int. While not allowed since C99, it became an error by default in GCC 14. `ISC_REFCOUNT_TRACE_IMPL` and `ISC_REFCOUNT_STATIC_TRACE_IMPL` expanded into the wrong macros, trying to declare it again with the wrong number of parameters. --- lib/isc/include/isc/refcount.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index ad361288b4..090dc7ec2a 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -127,7 +127,7 @@ typedef atomic_uint_fast32_t isc_refcount_t; stat void name##__attach(name##_t *ptr, name##_t **ptrp, \ const char *func, const char *file, \ unsigned int line); \ - stat name##__detach(name##_t **ptrp, const char *func, \ + stat void name##__detach(name##_t **ptrp, const char *func, \ const char *file, unsigned int line) #define ISC_REFCOUNT_BLANK @@ -190,9 +190,9 @@ typedef atomic_uint_fast32_t isc_refcount_t; } #define ISC_REFCOUNT_TRACE_IMPL(name, destroy) \ - ISC__REFCOUNT_TRACE_DECL(name, destroy, ISC_REFCOUNT_BLANK) + ISC__REFCOUNT_TRACE_IMPL(name, destroy, ISC_REFCOUNT_BLANK) #define ISC_REFCOUNT_STATIC_TRACE_IMPL(name, destroy) \ - ISC__REFCOUNT_TRACE_DECL(name, destroy, static inline) + ISC__REFCOUNT_TRACE_IMPL(name, destroy, static inline) #define ISC__REFCOUNT_DECL(name, stat) \ stat name##_t *name##_ref(name##_t *ptr) __attribute__((unused)); \ From 03a59cbb04943f6fecb1bb84535ff9d29679bdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Mercan?= Date: Fri, 17 May 2024 16:52:42 +0300 Subject: [PATCH 2/2] reinsert accidentally removed + in db trace It only affects development when using `DNS_DB_TRACE`. --- lib/dns/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/db.c b/lib/dns/db.c index 013065c26d..ad082bbe2b 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -151,7 +151,7 @@ dns_db_create(isc_mem_t *mctx, const char *db_type, const dns_name_t *origin, #if DNS_DB_TRACE fprintf(stderr, "dns_db_create:%s:%s:%d:%p->references = 1\n", - __func__, __FILE__, __LINE__ 1, *dbp); + __func__, __FILE__, __LINE__ + 1, *dbp); #endif return (result); }