]> Savannah Git Hosting - gnulib.git/commitdiff
readline: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 19:55:00 +0000 (21:55 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 19:55:00 +0000 (21:55 +0200)
* lib/readline.h: Include <stdlib.h>.
(readline): Declare that deallocation must happen through 'free'.

ChangeLog
lib/readline.h

index baaad7c76a62c18787aefa36b22a50497258ce19..8ce06c44db867e4defeee7ef34ab96037cc5a0ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       readline: Improve GCC 11 allocation-deallocation checking.
+       * lib/readline.h: Include <stdlib.h>.
+       (readline): Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        read-file: Improve GCC 11 allocation-deallocation checking.
index 57acdf75c395cbe1dd4040e31982b59b589732e0..e4b6f9b6b7192cda2af429b3871d4c4f9f705d78 100644 (file)
 # include <stdio.h>
 # include <readline/readline.h>
 #else
+# include <stdlib.h>
 /* Prints a prompt PROMPT and then reads and returns a single line of
    text from the user.  If PROMPT is NULL or the empty string, no
    prompt is displayed.  The returned line is allocated with malloc;
    the caller should free the line when it has finished with it. */
-extern char *readline (const char *prompt);
+extern char *readline (const char *prompt)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 #endif
 
 #endif /* GL_READLINE_H */