]> Savannah Git Hosting - gnulib.git/commit
posix_memalign: check for GNU behavior with size 0
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Oct 2024 19:47:02 +0000 (12:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Oct 2024 19:50:24 +0000 (12:50 -0700)
commit99bbb61c05e95658cde543b69a2429c6bd33998a
treec1ee320c2521e4b22d7290947886c366b535ea6b
parente6108a3b3e65cd9b3c1899a0fb88d368c1626c58
posix_memalign: check for GNU behavior with size 0

* lib/posix_memalign.c: Include stdckdint.h.
(posix_memalign): Test for overflow more straightforwardly,
and more portably to unlikely platforms where SIZE_MAX <= INT_MAX.
Treat a zero size as if it were alignment.
* m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN):
* tests/test-posix_memalign.c (main):
Test zero size too.  Use volatile to avoid compiler optimizations.
* modules/posix_memalign (Depends-on): Add stdckdint.
ChangeLog
doc/posix-functions/posix_memalign.texi
lib/posix_memalign.c
m4/posix_memalign.m4
modules/posix_memalign
tests/test-posix_memalign.c