1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-10 04:43:00 +03:00
Commit Graph

5 Commits

Author SHA1 Message Date
Paul Eggert
d884e6fc4a realloc-posix: realloc (..., 0) now returns nonnull
* lib/realloc.c (rpl_realloc): Simplify and tune by using
HAVE_REALLOC_0_NONNULL and HAVE_MALLOC_PTRDIFF, and
by having just one call to realloc instead of two.
* lib/reallocarray.c (reallocarray): Simplify and tune
by delegating the zero case to the revised realloc.
* m4/eealloc.m4 (_AC_FUNC_REALLOC_IF): Since only eealloc uses
this macro now, move its definition here ...
* m4/realloc.m4: ... from here.
(gl_FUNC_REALLOC_0_NONNULL): Also check that realloc (p, 0)
returns nonnull.  Require gl_FUNC_REALLOC_POSIX.
Define HAVE_REALLOC_0_NONNULL.
* m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY):
Also replace reallocarray if it returns a null pointer for size zero.
* modules/eealloc (Files): Remove m4/realloc.m4.
* modules/realloc-posix (Depends-on): Add extensions-aix.
* modules/reallocarray (Files): Add m4/realloc.m4.
2024-11-04 21:40:18 -08:00
Bruno Haible
c36a0f21b3 doc: Add a module index.
* doc/Makefile (undocumented-modules.texi): New rule.
(%.info, %.html, %.dvi, %.pdf): Depend on undocumented-modules.texi.
(mostlyclean): Remove also *.m and *.tmp.
(force): New rule.
* doc/*.texi: Add module index entries.
* doc/*/*.texi: Likewise.
2024-10-27 17:02:57 +01:00
Paul Eggert
4d7d5e4279 realloc: still more improvements for realloc (p, 0)
* doc/posix-functions/malloc.texi: AIX is sans _LINUX_SOURCE_COMPAT.
* doc/posix-functions/realloc.texi:
Give more details about what recent POSIX versions say,
and fix some misperceptions about C89 through C11.
Document that the GNU behavior does not conform to POSIX,
and that AIX's behavior with _LINUX_SOURCE_COMPAT
matches glibc's circa 1999 behavior, not its current behavior.
Be a little less confident about realloc-gnu, since it doesn't
fully implement current glibc behavior.
Give more details about when memory leaks or false positives can occur.
* doc/posix-functions/reallocarray.texi:
Say that it shares realloc’s woes with zero sizes.
2024-10-24 21:57:17 -07:00
Bruno Haible
adfbfffa41 doc: Sort the ISO C and POSIX Function Substitutes by header file.
* doc/gnulib.texi (Function Substitutes): Add one section per header
file.
* doc/posix-functions/*.texi: Each of these files is now a subsection.
2024-07-20 20:02:14 +02:00
Bruno Haible
0c7f50628b doc: Update status of functions that are added in POSIX:2024.
* doc/posix-functions/_Fork.texi: Moved here from doc/glibc-functions/.
* doc/posix-functions/accept4.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/bind_textdomain_codeset.texi: Likewise.
* doc/posix-functions/bindtextdomain.texi: Likewise.
* doc/posix-functions/dcgettext.texi: Likewise.
* doc/posix-functions/dcngettext.texi: Likewise.
* doc/posix-functions/dgettext.texi: Likewise.
* doc/posix-functions/dladdr.texi: Likewise.
* doc/posix-functions/dngettext.texi: Likewise.
* doc/posix-functions/dup3.texi: Likewise.
* doc/posix-functions/ffsl.texi: Likewise.
* doc/posix-functions/ffsll.texi: Likewise.
* doc/posix-functions/getentropy.texi: Likewise.
* doc/posix-functions/getresgid.texi: Likewise.
* doc/posix-functions/getresuid.texi: Likewise.
* doc/posix-functions/gettext.texi: Likewise.
* doc/posix-functions/in6addr_any.texi: Likewise.
* doc/posix-functions/in6addr_loopback.texi: Likewise.
* doc/posix-functions/memmem.texi: Likewise.
* doc/posix-functions/mkostemp.texi: Likewise.
* doc/posix-functions/ngettext.texi: Likewise.
* doc/posix-functions/pipe2.texi: Likewise.
* doc/posix-functions/ppoll.texi: Likewise.
* doc/posix-functions/pthread_cond_clockwait.texi: Likewise.
* doc/posix-functions/pthread_mutex_clocklock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_clockrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_clockwrlock.texi: Likewise.
* doc/posix-functions/ptsname_r.texi: Likewise.
* doc/posix-functions/qsort_r.texi: Likewise.
* doc/posix-functions/secure_getenv.texi: Likewise.
* doc/posix-functions/sem_clockwait.texi: Likewise.
* doc/posix-functions/setresgid.texi: Likewise.
* doc/posix-functions/setresuid.texi: Likewise.
* doc/posix-functions/textdomain.texi: Likewise.
* doc/posix-functions/timespec_get.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/posix-functions/reallocarray.texi: Likewise. Improve text.
* doc/gnulib.texi (Function Substitutes): Include them here.
(Glibc Function Substitutes): Don't include them here.
(Glibc libintl.h): Remove section.
(Glibc poll.h): Remove section.
(Glibc semaphore.h): Remove section.
2024-07-20 15:34:55 +02:00