>From 4c424dc470b6ec000c0a10bb649f07358813f842 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 23:36:42 +0200 Subject: [PATCH 2/2] xgetdomainname: Improve GCC 11 allocation-deallocation checking. * lib/xgetdomainname.h: Include . (xgetdomainname): Declare that deallocation must happen through 'free'. --- ChangeLog | 6 ++++++ lib/xgetdomainname.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9073c37..0cb5d61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-08-07 Bruno Haible + xgetdomainname: Improve GCC 11 allocation-deallocation checking. + * lib/xgetdomainname.h: Include . + (xgetdomainname): Declare that deallocation must happen through 'free'. + +2021-08-07 Bruno Haible + xgetdomainname: Ensure .c file starts with '#include '. * lib/xgetaname-impl.h: New file, based on lib/xgethostname.c. * lib/xgethostname.c: Move implementation to lib/xgetaname-impl.h. diff --git a/lib/xgetdomainname.h b/lib/xgetdomainname.h index 2ac9819..389a9fc 100644 --- a/lib/xgetdomainname.h +++ b/lib/xgetdomainname.h @@ -18,6 +18,8 @@ #ifndef _XGETDOMAINNAME_H #define _XGETDOMAINNAME_H +#include + /* Return the NIS domain name of the machine, in malloc'd storage. WARNING! The NIS domain name is unrelated to the fully qualified host name of the machine. It is also unrelated to email addresses. @@ -25,6 +27,7 @@ not using NIS. If malloc fails, exit. Upon any other failure, set errno and return NULL. */ -extern char *xgetdomainname (void); +extern char *xgetdomainname (void) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; #endif /* _XGETDOMAINNAME_H */ -- 2.7.4