From 741631c9b012baab1725e43557fabf384d71f169 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 19 Dec 2020 00:18:50 +0100 Subject: [PATCH] free-posix: New module, renamed from 'free'. * modules/free-posix: Renamed from modules/free. (configure.ac): Update gl_STDLIB_MODULE_INDICATOR invocation. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_FREE_POSIX, not GNULIB_FREE. * modules/stdlib (Makefile.am): Substitute GNULIB_FREE_POSIX, not GNULIB_FREE. * lib/stdlib.in.h (free): Test GNULIB_FREE_POSIX, not GNULIB_FREE. * doc/posix-functions/free.texi: Mention the module 'free-posix' and what it does. * NEWS: Mention that module 'free' no longer exists. * modules/canonicalize (Depends-on): Add free-posix. Remove free. * modules/canonicalize-lgpl (Depends-on): Likewise. --- ChangeLog | 16 ++++++++++++++++ NEWS | 2 ++ doc/posix-functions/free.texi | 4 +++- lib/stdlib.in.h | 2 +- m4/stdlib_h.m4 | 4 ++-- modules/canonicalize | 2 +- modules/canonicalize-lgpl | 2 +- modules/{free => free-posix} | 2 +- modules/stdlib | 2 +- 9 files changed, 28 insertions(+), 8 deletions(-) rename modules/{free => free-posix} (87%) diff --git a/ChangeLog b/ChangeLog index 14db75ab28..049f719580 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2020-12-18 Bruno Haible + free-posix: New module, renamed from 'free'. + * modules/free-posix: Renamed from modules/free. + (configure.ac): Update gl_STDLIB_MODULE_INDICATOR invocation. + * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_FREE_POSIX, + not GNULIB_FREE. + * modules/stdlib (Makefile.am): Substitute GNULIB_FREE_POSIX, not + GNULIB_FREE. + * lib/stdlib.in.h (free): Test GNULIB_FREE_POSIX, not GNULIB_FREE. + * doc/posix-functions/free.texi: Mention the module 'free-posix' and + what it does. + * NEWS: Mention that module 'free' no longer exists. + * modules/canonicalize (Depends-on): Add free-posix. Remove free. + * modules/canonicalize-lgpl (Depends-on): Likewise. + +2020-12-18 Bruno Haible + free: Remove support for obsolete platforms. * m4/free.m4 (gl_FUNC_FREE): Assume free(NULL) works. Don't define CANNOT_FREE_NULL. diff --git a/NEWS b/NEWS index 09d1987fb6..7679be06c5 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,8 @@ User visible incompatible changes Date Modules Changes +2020-12-18 free This module, obsoleted in 2008, is gone. + 2020-12-14 findprog-in The function 'find_in_given_path' now takes a 3rd argument 'const char *directory'. To maintain the previous behaviour, insert NULL as additional 3rd diff --git a/doc/posix-functions/free.texi b/doc/posix-functions/free.texi index 1c397d14ee..a7ceec130b 100644 --- a/doc/posix-functions/free.texi +++ b/doc/posix-functions/free.texi @@ -4,10 +4,12 @@ POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html} -Gnulib module: free +Gnulib module: free-posix Portability problems fixed by Gnulib: @itemize +@item +This function may clobber @code{errno} on many platforms. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index a512459e2d..1964443a22 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -284,7 +284,7 @@ _GL_CXXALIAS_SYS (fcvt, char *, _GL_CXXALIASWARN (fcvt); #endif -#if @GNULIB_FREE@ +#if @GNULIB_FREE_POSIX@ # if @REPLACE_FREE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef free diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 6b519c4e37..7e03b9a6d5 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 53 +# stdlib_h.m4 serial 54 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -62,7 +62,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) - GNULIB_FREE=0; AC_SUBST([GNULIB_FREE]) + GNULIB_FREE_POSIX=0; AC_SUBST([GNULIB_FREE_POSIX]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) diff --git a/modules/canonicalize b/modules/canonicalize index 4853cf901e..e1b7607046 100644 --- a/modules/canonicalize +++ b/modules/canonicalize @@ -13,7 +13,7 @@ errno extensions file-set filename -free +free-posix getcwd hash-triple-simple idx diff --git a/modules/canonicalize-lgpl b/modules/canonicalize-lgpl index d4dfcc9057..e94a898bd6 100644 --- a/modules/canonicalize-lgpl +++ b/modules/canonicalize-lgpl @@ -13,7 +13,7 @@ nocrash double-slash-root [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] errno [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] filename [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] -free [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] +free-posix [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] idx [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] libc-config [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] malloc-posix [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1] diff --git a/modules/free b/modules/free-posix similarity index 87% rename from modules/free rename to modules/free-posix index 29ec637bd7..f48e38851b 100644 --- a/modules/free +++ b/modules/free-posix @@ -14,7 +14,7 @@ if test $REPLACE_FREE = 1; then AC_LIBOBJ([free]) gl_PREREQ_FREE fi -gl_STDLIB_MODULE_INDICATOR([free]) +gl_STDLIB_MODULE_INDICATOR([free-posix]) Makefile.am: diff --git a/modules/stdlib b/modules/stdlib index 1daa0f9619..68583f830d 100644 --- a/modules/stdlib +++ b/modules/stdlib @@ -36,7 +36,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ - -e 's/@''GNULIB_FREE''@/$(GNULIB_FREE)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ -- 2.11.4.GIT