From: Bruno Haible Date: Sat, 7 Aug 2021 21:05:51 +0000 (+0200) Subject: windows-spawn: Improve GCC 11 allocation-deallocation checking. X-Git-Tag: v1.0~2687 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4a0993e377f69cdf533d72f00d74471af870bb05;p=gnulib.git windows-spawn: Improve GCC 11 allocation-deallocation checking. * lib/windows-spawn.h: Include . (compose_command, compose_envblock): Declare that deallocation must happen through 'free'. --- diff --git a/ChangeLog b/ChangeLog index b87440ed06..2a8bcf90e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + windows-spawn: Improve GCC 11 allocation-deallocation checking. + * lib/windows-spawn.h: Include . + (compose_command, compose_envblock): Declare that deallocation must + happen through 'free'. + 2021-08-07 Bruno Haible string-buffer: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h index 78c773621c..5ba46644c7 100644 --- a/lib/windows-spawn.h +++ b/lib/windows-spawn.h @@ -20,6 +20,7 @@ #include #include +#include /* Get declarations of the native Windows API functions. */ #define WIN32_LEAN_AND_MEAN @@ -72,14 +73,16 @@ extern const char ** prepare_spawn (const char * const *argv, prepare_spawn. Returns a freshly allocated string. In case of memory allocation failure, NULL is returned, with errno set. */ -extern char * compose_command (const char * const *argv); +extern char * compose_command (const char * const *argv) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; /* Composes the block of memory that contains the environment variables. ENVP must contain an environment (a NULL-terminated array of string of the form VARIABLE=VALUE). Returns a freshly allocated block of memory. In case of memory allocation failure, NULL is returned, with errno set. */ -extern char * compose_envblock (const char * const *envp); +extern char * compose_envblock (const char * const *envp) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; /* This struct keeps track of which handles to pass to a subprocess, and with