]> Savannah Git Hosting - gnulib.git/commitdiff
clean-temp: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:23:57 +0000 (19:23 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:23:57 +0000 (19:23 +0200)
* lib/clean-temp.h (cleanup_temp_dir): Move declaration up.
(create_temp_dir): Declare that deallocation must happen through
'cleanup_temp_dir'.

ChangeLog
lib/clean-temp.h

index a4827f31a3f7660898cf6cb4ee78021ecd22e9a0..67019f31b1943a66ae2750abfa8f182b1afb65c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       clean-temp: Improve GCC 11 allocation-deallocation checking.
+       * lib/clean-temp.h (cleanup_temp_dir): Move declaration up.
+       (create_temp_dir): Declare that deallocation must happen through
+       'cleanup_temp_dir'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        canon-host: Improve GCC 11 allocation-deallocation checking.
index db4d7fea261ce19bcbe21571d0e02e72a3e4a84a..676c192d15c3c2b256b1cb54e2ec66fa90f4752d 100644 (file)
@@ -78,6 +78,11 @@ struct temp_dir
   /* More fields are present here, but not public.  */
 };
 
+/* Remove all registered files and subdirectories inside DIR and DIR itself.
+   DIR cannot be used any more after this call.
+   Return 0 upon success, or -1 if there was some problem.  */
+extern int cleanup_temp_dir (struct temp_dir *dir);
+
 /* Create a temporary directory.
    PREFIX is used as a prefix for the name of the temporary directory. It
    should be short and still give an indication about the program.
@@ -89,7 +94,8 @@ struct temp_dir
    is shown and NULL is returned.  */
 extern struct temp_dir * create_temp_dir (const char *prefix,
                                           const char *parentdir,
-                                          bool cleanup_verbose);
+                                          bool cleanup_verbose)
+  _GL_ATTRIBUTE_DEALLOC (cleanup_temp_dir, 1);
 
 /* Register the given ABSOLUTE_FILE_NAME as being a file inside DIR, that
    needs to be removed before DIR can be removed.
@@ -130,11 +136,6 @@ extern int cleanup_temp_subdir (struct temp_dir *dir,
    Return 0 upon success, or -1 if there was some problem.  */
 extern int cleanup_temp_dir_contents (struct temp_dir *dir);
 
-/* Remove all registered files and subdirectories inside DIR and DIR itself.
-   DIR cannot be used any more after this call.
-   Return 0 upon success, or -1 if there was some problem.  */
-extern int cleanup_temp_dir (struct temp_dir *dir);
-
 /* ================== Opening and closing temporary files ================== */
 
 /* Open a temporary file in a temporary directory.