From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: canon-host: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 19:21:49 +0200 [thread overview]
Message-ID: <2352458.O1IUMocyEE@omega> (raw)
2021-08-07 Bruno Haible <bruno@clisp.org>
canon-host: Improve GCC 11 allocation-deallocation checking.
* lib/canon-host.h: Include <stdlib.h>.
(canon_host, canon_host_r): Declare that deallocation must happen
through 'free'.
diff --git a/lib/canon-host.h b/lib/canon-host.h
index fb35bfe..2891925 100644
--- a/lib/canon-host.h
+++ b/lib/canon-host.h
@@ -20,8 +20,12 @@
#ifndef CANON_HOST_H
# define CANON_HOST_H 1
-char *canon_host (char const *host) _GL_ATTRIBUTE_MALLOC;
-char *canon_host_r (char const *host, int *cherror) _GL_ATTRIBUTE_MALLOC;
+# include <stdlib.h>
+
+char *canon_host (char const *host)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+char *canon_host_r (char const *host, int *cherror)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
const char *ch_strerror (void);
# define ch_strerror_r(cherror) gai_strerror (cherror);
reply other threads:[~2021-08-07 17:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2352458.O1IUMocyEE@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).