Hi Paul,
On 8/22/21 10:12 PM, Paul Eggert wrote:
> Subject: [PATCH 4/4] df: pacify -Wsuggest-attribute=malloc
>
> Problem found with latest Gnulib and GCC 11.2.1.
> * src/find-mount-point.h (find_mount_point):
> Add _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.
> ---
> src/find-mount-point.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/find-mount-point.h b/src/find-mount-point.h
> index 028b2500c..a1bbcdc92 100644
> --- a/src/find-mount-point.h
> +++ b/src/find-mount-point.h
> @@ -14,4 +14,7 @@
> You should have received a copy of the GNU General Public License
> along with this program. If not, see . */
>
> -extern char *find_mount_point (char const *, struct stat const *);
> +#include
> +
> +extern char *find_mount_point (char const *, struct stat const *)
> + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
`make syntax-check` complains:
src/find-mount-point.h:17:#include
maint.mk: the above are already included via system.h
make: *** [cfg.mk:174: sc_system_h_headers] Error 1
The attached fixes it.
Was there a particular reason to include stdlib.h?
Have a nice day,
Berny