tst-calloc build failure with GCC mainline

Joseph Myers josmyers@redhat.com
Tue Jan 7 22:19:44 GMT 2025


With recent GCC mainline I see build failures in tst-calloc, of the form:

In function 'null_test',
    inlined from 'do_test' at tst-calloc.c:126:3,
    inlined from 'legacy_test_function' at ../test-skeleton.c:54:10:
tst-calloc.c:105:3: error: argument 2 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
  105 |   calloc (0, ~((size_t) 0));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~

I suspect this arises from GCC commit

commit 804e9d55d9e54cffd32d8dd065bf3c785b1edbf4
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jan 6 10:12:00 2025 +0100

    tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224]

and so either we need to stop the calloc built-in function being visible 
in this test, or we need to disable this warning for these tests of calloc 
with a large argument.

-- 
Joseph S. Myers
josmyers@redhat.com



More information about the Libc-alpha mailing list