diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-04-24 14:46:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-04-25 08:25:33 +0200 |
commit | 863b26ee3a5ab938c2003bcdbc5b82957f917997 (patch) | |
tree | dc7390da9382398f280a65bd72188af08a3936a9 /testsuites | |
parent | bsps/powerpc: Fix warnings with PPC_SPECIAL_PURPOSE_REGISTER (diff) | |
download | rtems-863b26ee3a5ab938c2003bcdbc5b82957f917997.tar.bz2 |
score: Avoid cyclic header file dependencies
There was a cyclic dependency: For RTEMS_STATIC_ANALYSIS we needed
basedefs.h in assert.h. For RTEMS_UNREACHABLE() we needed _Assert() from
assert.h in basedefs.h.
Fix this by introducing _Debug_Unreachable() in basedefs.h.
Add RTEMS_FUNCTION_NAME to basedefs.h and use it in basedefs.h and
assert.h.
Close #4900.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/validation/tc-basedefs-no-debug.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/testsuites/validation/tc-basedefs-no-debug.c b/testsuites/validation/tc-basedefs-no-debug.c index 2566107730..479f563cdb 100644 --- a/testsuites/validation/tc-basedefs-no-debug.c +++ b/testsuites/validation/tc-basedefs-no-debug.c @@ -72,9 +72,9 @@ * * - Check that the string is equal to the expected statement. * - * - Expand and stringify _Assert_Unreachable(). + * - Expand RTEMS_FUNCTION_NAME. * - * - Check that the string is equal to the expected statement. + * - Check that the string is equal to the expected function name. * * @{ */ @@ -95,24 +95,30 @@ static void RtemsBasedefsValBasedefsNoDebug_Action_0( void ) 0, IsEqualIgnoreWhiteSpace( s, - "do{__builtin_unreachable();do{}while(0);}while(0)" + "__builtin_unreachable()" ) ); } /** - * @brief Expand and stringify _Assert_Unreachable(). + * @brief Expand RTEMS_FUNCTION_NAME. */ static void RtemsBasedefsValBasedefsNoDebug_Action_1( void ) { const char *s; - s = RTEMS_XSTRING( _Assert_Unreachable() ); + s = RTEMS_FUNCTION_NAME; /* - * Check that the string is equal to the expected statement. + * Check that the string is equal to the expected function name. */ - T_step_true( 1, IsEqualIgnoreWhiteSpace( s, "do{}while(0)" ) ); + T_step_true( + 1, + IsEqualIgnoreWhiteSpace( + s, + "RtemsBasedefsValBasedefsNoDebug_Action_1" + ) + ); } /** |