From de0e1b45b0aba18ce50de40e42028af2c50e335c Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 11 Jan 2021 12:03:38 -0300 Subject: malloc: Sync dynarray with gnulib It syncs with gnulib version a8bac4d49. The main changes are: - Remove the usage of anonymous union within DYNARRAY_STRUCT. - Use DYNARRAY_FREE instead of DYNARRAY_NAME (free) so that Gnulib does not change 'free' to 'rpl_free'. - Use __nonnull instead of __attribute__ ((nonnull ())). - Use __attribute_maybe_unused__ instead of __attribute__ ((unused, nonnull (1))). - Use of _Noreturn instead of _attribute__ ((noreturn)). The only difference with gnulib is: --- glibc +++ gnulib @@ -18,6 +18,7 @@ #include #include +#include void __libc_dynarray_at_failure (size_t size, size_t index) @@ -27,7 +28,6 @@ __snprintf (buf, sizeof (buf), "Fatal glibc error: " "array index %zu not less than array length %zu\n", index, size); - __libc_fatal (buf); #else abort (); #endif It seems a wrong sync from gnulib (the code is used on loader and thus it requires __libc_fatal instead of abort). Checked on x86_64-linux-gnu. --- malloc/dynarray.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'malloc/dynarray.h') diff --git a/malloc/dynarray.h b/malloc/dynarray.h index 24ca1620d2..638c33f986 100644 --- a/malloc/dynarray.h +++ b/malloc/dynarray.h @@ -165,8 +165,7 @@ bool __libc_dynarray_finalize (struct dynarray_header *list, void *scratch, /* Internal function. Terminate the process after an index error. SIZE is the number of elements of the dynamic array. INDEX is the lookup index which triggered the failure. */ -void __libc_dynarray_at_failure (size_t size, size_t index) - __attribute__ ((noreturn)); +_Noreturn void __libc_dynarray_at_failure (size_t size, size_t index); #ifndef _ISOMAC libc_hidden_proto (__libc_dynarray_emplace_enlarge) -- cgit v1.2.3