From: Bruno Haible Date: Sat, 7 Aug 2021 19:55:00 +0000 (+0200) Subject: readline: Improve GCC 11 allocation-deallocation checking. X-Git-Tag: v1.0~2694 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=fe15063a016258d81bf3cec3754ee41a1d317a3b;p=gnulib.git readline: Improve GCC 11 allocation-deallocation checking. * lib/readline.h: Include . (readline): Declare that deallocation must happen through 'free'. --- diff --git a/ChangeLog b/ChangeLog index baaad7c76a..8ce06c44db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-08-07 Bruno Haible + + readline: Improve GCC 11 allocation-deallocation checking. + * lib/readline.h: Include . + (readline): Declare that deallocation must happen through 'free'. + 2021-08-07 Bruno Haible read-file: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/readline.h b/lib/readline.h index 57acdf75c3..e4b6f9b6b7 100644 --- a/lib/readline.h +++ b/lib/readline.h @@ -24,11 +24,13 @@ # include # include #else +# include /* 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 */