1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

30 Commits

Author SHA1 Message Date
Collin Funk
a8482ceecf maint: run 'make update-copyright' 2026-01-01 10:37:05 -08:00
Pádraig Brady
7b08932179 maint: run 'make update-copyright' 2025-01-01 09:25:10 +00:00
Paul Eggert
41be6842b5 malloc etc. tests: use volatile more consistently
Typically it’s ineffective to use ‘void *volatile p’
when testing malloc and similar functions, as the compiler
can optimize the call to malloc before assigning the result
to the volatile pointer variable.  Instead, be more systematic
about calling malloc through a volatile function pointer
so that the compiler cannot infer that it is a malloc call.
This fix can’t be done for alloca-like functions which may not
have a function address, so continue to trust to luck there.
* tests/test-aligned-malloc.c (aligned4_malloc, aligned4_free)
(aligned8_malloc, aligned8_free, aligned16_malloc)
(aligned16_free, aligned32_malloc, aligned32_free):
* tests/test-aligned_alloc.c (aligned_alloc):
* tests/test-calloc-gnu.c (calloc):
* tests/test-free.c (free):
* tests/test-malloc-gnu.c (malloc):
* tests/test-reallocarray.c (reallocarray):
Test indirectly, by calling through a volatile pointer.
* tests/test-aligned-malloc.c, tests/test-aligned_alloc.c:
* tests/test-calloc-gnu.c, tests/test-calloc-posix.c:
* tests/test-free.c, tests/test-malloc-gnu.c:
* tests/test-malloc-posix.c, tests/test-realloc-posix.c:
* tests/test-reallocarray.c:
(main) Don’t bother making data pointers olatile, as it’s ineffective.
* tests/test-calloc-gnu.c (identity):
* tests/test-free.c (get_errno, get_errno_func):
Remove; all uses removed.
2024-11-04 09:40:29 -08:00
Bruno Haible
3a5f51783b tests: Support showing all assertion failures, not just the first one.
* tests/macros.h (CONTINUE_AFTER_ASSERT): New macro.
(test_exit_status): New variable.
(ASSERT, ASSERT_NO_STDIO): If CONTINUE_AFTER_ASSERT is 1, set
test_exit_status instead of aborting.
* tests/**/test-*.{c,h,cc} (main): Instead of exiting with exit code 0,
exit with exit code test_exit_status.
* tests/test-spawn-pipe-child.c: Undefine CONTINUE_AFTER_ASSERT.
* tests/uninorm/test-nf*.c: Include macros.h.
* tests/uninorm/test-u32-nf*-big.c: Likewise.
* tests/random*.c: Define NO_MAIN_HERE.
2024-05-18 23:33:58 +02:00
Simon Josefsson
5b92dd0a45 maint: run 'make update-copyright' 2024-01-01 10:31:48 +01:00
Bruno Haible
cc58717033 Fix some "make sc_prohibit_leading_TABs" findings.
* tests/test-calloc-gnu.c: Expand tabs.
* tests/test-regex.c: Likewise.
2023-04-11 19:37:24 +02:00
Simon Josefsson
32a72f4537 maint: run 'make update-copyright' 2023-01-01 01:14:21 +01:00
Bernhard Voelker
87e6634b28 license: fix GPLv3 texts to use a comma instead of semicolon.
See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Run:
  $ git grep -l 'Foundation; either version 3' \
      | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'

* All files using GPLv3: Adjust via the above command.
2022-01-05 11:56:23 +01:00
Paul Eggert
eec12c00cf maint: run 'make update-copyright' 2022-01-01 09:44:11 -08:00
Bruno Haible
f6b9c58618 *alloc-gnu tests: Use ASSERT macro.
* tests/test-malloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-calloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-realloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-reallocarray.c: Include "macros.h".
(main): Use ASSERT.
* modules/malloc-gnu-tests (Files): Add tests/macros.h.
* modules/calloc-gnu-tests (Files): Likewise.
* modules/realloc-gnu-tests (Files): Likewise.
* modules/reallocarray-tests (Files): Likewise.
2021-05-14 15:53:31 +02:00
Bruno Haible
3189c490ec malloc-gnu, realloc-gnu, calloc-gnu tests: Verify errno is set.
* tests/test-malloc-gnu.c: Include <errno.h>.
(main): Verify that, when an allocation larger than PTRDIFF_MAX failed,
errno is ENOMEM.
* tests/test-realloc-gnu.c: Likewise.
* tests/test-calloc-gnu.c: Likewise.
2021-05-09 18:34:58 +02:00
Paul Eggert
e25cfaa3b5 calloc-gnu-tests: add overflow tests
* tests/test-calloc-gnu.c (identity): New function, replacing ‘eight’.
(main): Do 2 * log2(SIZE_MAX) tests instead of just two tests.
Don’t bother to free on failure.
2021-04-24 10:47:39 -07:00
Paul Eggert
abe94812b3 malloc-gnu-tests, etc.: test ptrdiff_t overflow
* modules/calloc-gnu-tests (Depends-on):
* modules/malloc-gnu-tests (Depends-on):
* modules/realloc-gnu-tests (Depends-on): Add stdint.
* tests/test-calloc-gnu.c (main):
* tests/test-malloc-gnu.c (main):,
* tests/test-realloc-gnu.c (main): Test for ptrdiff_t overflow.
2021-04-18 15:30:09 -07:00
Paul Eggert
4b94832196 maint: run 'make update-copyright' 2020-12-31 23:30:01 -08:00
Bruno Haible
1e972a8a37 calloc-gnu tests: Avoid a test failure with clang.
* tests/test-calloc-gnu.c (main): Mark the pointer variable as
'volatile', to defeat compiler optimizations.
2020-06-06 10:16:09 +02:00
Paul Eggert
2cdc1bafb2 maint: Run 'make update-copyright' 2019-12-31 16:02:16 -08:00
Paul Eggert
e6633650a2 maint: Run 'make update-copyright' 2019-01-01 00:30:05 +01:00
Paul Eggert
281b825eba maint: Run 'make update-copyright' 2018-01-01 00:58:38 +00:00
Paul Eggert
ca35d46812 all: prefer https: URLs 2017-09-13 00:48:57 -07:00
Bruno Haible
8250f4c6d0 test-calloc-gnu: Reenable test also for GCC 7.
* tests/test-calloc-gnu.c (eight): New function.
(main): Don't skip test; use eight() instead.
2017-03-05 02:22:19 +01:00
Jim Meyering
26034f242a test-calloc-gnu: port to GCC7
* tests/test-calloc-gnu.c (main) [__GNUC__ >= 7]: Skip a test
that attempts to calloc more than SIZE_MAX bytes, because GCC7
and newer would detect that at compilation time.
2017-03-04 14:51:50 -08:00
Paul Eggert
a3fd683de3 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2017-01-01 02:59:23 +00:00
Paul Eggert
54615b95ff misc: port better to gcc -fsanitize=address
Without these patches, ./configure CFLAGS='-fsanitize=address'
would compute incorrect values.  This patch fixes some (but not all)
test failures with recent glibc, with this configuration.
* m4/acl.m4 (gl_ACL_GET_FILE):
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF):
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS):
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO):
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE):
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL):
* m4/getdelim.m4 (gl_FUNC_GETDELIM):
* m4/getgroups.m4 (gl_FUNC_GETGROUPS):
* m4/getline.m4 (gl_FUNC_GETLINE):
* m4/malloc.m4 (_AC_FUNC_MALLOC_IF):
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF):
* m4/regex.m4 (gl_REGEX):
* m4/strndup.m4 (gl_FUNC_STRNDUP):
* tests/test-calloc-gnu.c (main):
* tests/test-duplocale.c (main):
* tests/test-getgroups.c (main):
* tests/test-getline.c (main):
* tests/test-inttostr.c (main):
* tests/test-localename.c (test_locale_name)
(test_locale_name_thread, test_locale_name_environ)
(test_locale_name_default):
* tests/test-regex.c (main):
* tests/test-setlocale1.c (main):
* tests/test-stat.h (test_stat_func):
Free heap-allocated storage before exiting.
* m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX):
Don't match *_foo symbols inserted by AddressSanitizer.
* tests/test-regex.c, tests/test-stat.c: Include stdlib.h, for 'free'.
2016-02-06 18:12:13 -08:00
Paul Eggert
71090a2a31 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2016-01-01 00:57:21 -08:00
Paul Eggert
b9bfe78424 version-etc: new year
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
2014-12-31 17:47:54 -08:00
Eric Blake
1276a2c5f2 maint: update copyright
I ran 'make update-copyright'.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-01 00:07:10 -07:00
Eric Blake
9fc81090f6 maint: update all copyright year number ranges
Run "make update-copyright".  Compare to commit 1602f0a from last year.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-01-01 00:50:58 +00:00
Jim Meyering
1602f0afed maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:04:58 +01:00
Jim Meyering
d60f3b0c6b maint: update almost all copyright ranges to include 2011
Run the new "make update-copyright" rule.
2011-01-01 22:12:59 +01:00
Ralf Wildenhues
c118fb3fc3 Tests for module 'calloc-gnu'.
* modules/calloc-gnu-tests: New file.
* tests/test-calloc-gnu.c: New file.
2010-08-28 23:44:57 +02:00