diff mbox series

[uclibc-ng-devel] stdlib: increase number of static atexit handlers to 32

Message ID 20240709080249.5335-1-marcus.haehnel@kernkonzept.com
State Accepted
Headers show
Series [uclibc-ng-devel] stdlib: increase number of static atexit handlers to 32 | expand

Commit Message

Marcus Haehnel July 9, 2024, 8:02 a.m. UTC
From: Yann Le Du <yann.le.du@kernkonzept.com>

The existing limit of 20 was found to be insufficient when moving from
gcc 8 to gcc 9. At the time a test ran already 16 handlers had been
installed leaving only minimal room for application installed handlers.

Musl uses 32, as does newlib. Further, the ISO C standard for C99
specifies that:

  The implementation shall support the registration of at least
  32 functions.

(7.20.4.2 The atexit function)

Co-authored-by: Yann Le Du <yann.le.du@kernkonzept.com>
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
---
 include/stdlib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/stdlib.h b/include/stdlib.h
index 8b1375184..d4e0b75e7 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -606,7 +606,7 @@  libc_hidden_proto(unsetenv)
 #ifdef __UCLIBC_DYNAMIC_ATEXIT__
 # define __UCLIBC_MAX_ATEXIT     INT_MAX
 #else
-# define __UCLIBC_MAX_ATEXIT     20
+# define __UCLIBC_MAX_ATEXIT     32
 #endif