From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: argv-iter: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 19:07:24 +0200 [thread overview]
Message-ID: <4812909.vLjMMdqt0J@omega> (raw)
2021-08-07 Bruno Haible <bruno@clisp.org>
argv-iter: Improve GCC 11 allocation-deallocation checking.
* lib/argv-iter.h (argv_iter_free): Move declaration up.
(argv_iter_init_argv, argv_iter_init_stream): Declare that deallocation
must happen through 'argv_iter_free'.
diff --git a/lib/argv-iter.h b/lib/argv-iter.h
*** a/lib/argv-iter.h
--- b/lib/argv-iter.h
***************
*** 30,42 ****
AI_ERR_READ
};
! struct argv_iterator *argv_iter_init_argv (char **argv)
_GL_ARG_NONNULL ((1));
struct argv_iterator *argv_iter_init_stream (FILE *fp)
! _GL_ARG_NONNULL ((1));
char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
_GL_ARG_NONNULL ((1, 2));
size_t argv_iter_n_args (struct argv_iterator const *)
_GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1));
- void argv_iter_free (struct argv_iterator *)
- _GL_ARG_NONNULL ((1));
--- 30,43 ----
AI_ERR_READ
};
! void argv_iter_free (struct argv_iterator *)
_GL_ARG_NONNULL ((1));
+
+ struct argv_iterator *argv_iter_init_argv (char **argv)
+ _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_DEALLOC (argv_iter_free, 1);
struct argv_iterator *argv_iter_init_stream (FILE *fp)
! _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_DEALLOC (argv_iter_free, 1);
char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
_GL_ARG_NONNULL ((1, 2));
size_t argv_iter_n_args (struct argv_iterator const *)
_GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1));
reply other threads:[~2021-08-07 17:07 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=4812909.vLjMMdqt0J@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).