[rtems commit] config: CONFIGURE_DISABLE_NEWLIB_REENTRANCY
Sebastian Huber
sebh at rtems.org
Mon Feb 21 12:41:27 UTC 2022
Module: rtems
Branch: master
Commit: d69acf87dc1fcb7c2f06f6e82376192c9aadfd3b
Changeset: http://git.rtems.org/rtems/commit/?id=d69acf87dc1fcb7c2f06f6e82376192c9aadfd3b
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Feb 18 16:33:10 2022 +0100
config: CONFIGURE_DISABLE_NEWLIB_REENTRANCY
Do not initialize Thread_Control::libc_reent if
CONFIGURE_DISABLE_NEWLIB_REENTRANCY is defined. This helps to catch errors
with a NULL pointer exception rather than a corruption of the thread control
block.
---
cpukit/include/rtems/confdefs/threads.h | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/cpukit/include/rtems/confdefs/threads.h b/cpukit/include/rtems/confdefs/threads.h
index 279c626..503a4b2 100644
--- a/cpukit/include/rtems/confdefs/threads.h
+++ b/cpukit/include/rtems/confdefs/threads.h
@@ -161,8 +161,6 @@ struct Thread_Configured_control {
#endif
#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
struct _reent Newlib;
- #else
- struct { /* Empty */ } Newlib;
#endif
};
@@ -176,13 +174,16 @@ const Thread_Control_add_on _Thread_Control_add_ons[] = {
Control.API_Extensions[ THREAD_API_RTEMS ]
),
offsetof( Thread_Configured_control, API_RTEMS )
- }, {
- offsetof(
- Thread_Configured_control,
- Control.libc_reent
- ),
- offsetof( Thread_Configured_control, Newlib )
}
+ #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+ , {
+ offsetof(
+ Thread_Configured_control,
+ Control.libc_reent
+ ),
+ offsetof( Thread_Configured_control, Newlib )
+ }
+ #endif
#if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
, {
offsetof(
More information about the vc
mailing list