From 0d03a938cc5b3a3a0fc8c05e943a6552f21b56af Mon Sep 17 00:00:00 2001 From: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:59:08 +0530 Subject: [PATCH] Fic clang compiler warnings (#711) Signed-off-by: Gaurav Aggarwal --- CMakeLists.txt | 7 ++++++- croutine.c | 12 ++++++------ portable/ThirdParty/GCC/Posix/utils/wait_for_event.h | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c57d46402..6faa93167 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,7 +262,12 @@ target_compile_options(freertos_kernel PRIVATE $<$:-Werror> $<$:-Weverything> - # TODO: Add in other Compilers here. + # Suppressions required to build clean with clang. + $<$:-Wno-unused-macros> + $<$:-Wno-padded> + $<$:-Wno-missing-variable-declarations> + $<$:-Wno-covered-switch-default> + $<$:-Wno-cast-align> ) diff --git a/croutine.c b/croutine.c index f38e96247..8969dc89b 100644 --- a/croutine.c +++ b/croutine.c @@ -43,12 +43,12 @@ /* Lists for ready and blocked co-routines. --------------------*/ - static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */ - static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */ - static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */ - static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */ - static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */ - static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */ + static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /**< Prioritised ready co-routines. */ + static List_t xDelayedCoRoutineList1; /**< Delayed co-routines. */ + static List_t xDelayedCoRoutineList2; /**< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */ + static List_t * pxDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used. */ + static List_t * pxOverflowDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */ + static List_t xPendingReadyCoRoutineList; /**< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */ /* Other file private variables. --------------------------------*/ CRCB_t * pxCurrentCoRoutine = NULL; diff --git a/portable/ThirdParty/GCC/Posix/utils/wait_for_event.h b/portable/ThirdParty/GCC/Posix/utils/wait_for_event.h index 65e3e5481..6f6efa3ea 100644 --- a/portable/ThirdParty/GCC/Posix/utils/wait_for_event.h +++ b/portable/ThirdParty/GCC/Posix/utils/wait_for_event.h @@ -26,8 +26,8 @@ * */ -#ifndef _WAIT_FOR_EVENT_H_ -#define _WAIT_FOR_EVENT_H_ +#ifndef WAIT_FOR_EVENT_H_ +#define WAIT_FOR_EVENT_H_ #include #include @@ -43,4 +43,4 @@ void event_signal( struct event * ev ); -#endif /* ifndef _WAIT_FOR_EVENT_H_ */ +#endif /* ifndef WAIT_FOR_EVENT_H_ */