]> Savannah Git Hosting - gnulib.git/commitdiff
argv-iter: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:05:31 +0000 (19:05 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:05:31 +0000 (19:05 +0200)
* 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'.

ChangeLog
lib/argv-iter.h

index 84d3d008c4387e0a6d231beb63d9c93403c09f9a..e07fc85bdaa20d5d9a1013149b9fc4085479b946 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        argp: Improve GCC 11 allocation-deallocation checking.
index bcffd8491fb28805ccbe2a9aa1274e139b0ea944..f84f8fccc63b1ae8d947f9dcf244318ed51ada8a 100644 (file)
@@ -30,13 +30,14 @@ enum argv_iter_err
   AI_ERR_READ
 };
 
-struct argv_iterator *argv_iter_init_argv (char **argv)
+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_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));
-void argv_iter_free (struct argv_iterator *)
-  _GL_ARG_NONNULL ((1));