Skip to content

Commit

Permalink
Fix compilation warnings with Clang (FreeRTOS#721)
Browse files Browse the repository at this point in the history
Fix compilation warnings with Clang

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
  • Loading branch information
aggarg committed Jul 25, 2023
1 parent a33ba8e commit cfd4c73
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3089,6 +3089,7 @@ xtaskswaitingtermination
xtaskswaitingtoreceive
xtaskswaitingtosend
xtasktodelete
xtasktomodify
xtasktonotify
xtasktoquery
xtasktoresume
Expand Down
8 changes: 8 additions & 0 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@

#endif

#ifndef configUSE_CORE_AFFINITY
#define configUSE_CORE_AFFINITY 0
#endif /* configUSE_CORE_AFFINITY */

#ifndef configUSE_MINIMAL_IDLE_HOOK
#define configUSE_MINIMAL_IDLE_HOOK 0
#endif /* configUSE_MINIMAL_IDLE_HOOK */

/* The timers module relies on xTaskGetSchedulerState(). */
#if configUSE_TIMERS == 1

Expand Down
4 changes: 2 additions & 2 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ typedef enum
* a call to xTaskCreateRestricted(). These regions can be redefined using
* vTaskAllocateMPURegions().
*
* @param xTask The handle of the task being updated.
* @param xTaskToModify The handle of the task being updated.
*
* @param[in] pxRegions A pointer to a MemoryRegion_t structure that contains the
* new memory region definitions.
Expand Down Expand Up @@ -1321,7 +1321,7 @@ BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
UBaseType_t uxCoreAffinityMask );
#endif

#if ( configUSE_CORE_AFFINITY == 1 )
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )

/**
* @brief Gets the core affinity mask for a task.
Expand Down
4 changes: 2 additions & 2 deletions portable/MemMang/heap_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
* of their memory address. */
typedef struct A_BLOCK_LINK
{
struct A_BLOCK_LINK * pxNextFreeBlock; /*<< The next free block in the list. */
size_t xBlockSize; /*<< The size of the free block. */
struct A_BLOCK_LINK * pxNextFreeBlock; /**< The next free block in the list. */
size_t xBlockSize; /**< The size of the free block. */
} BlockLink_t;

/*-----------------------------------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions portable/ThirdParty/GCC/Posix/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,12 @@ static void prvSetupSignalsAndSchedulerPolicy( void )
}
/*-----------------------------------------------------------*/

unsigned long ulPortGetRunTime( void )
uint32_t ulPortGetRunTime( void )
{
struct tms xTimes;

times( &xTimes );

return ( unsigned long ) xTimes.tms_utime;
return ( uint32_t ) xTimes.tms_utime;
}
/*-----------------------------------------------------------*/
3 changes: 2 additions & 1 deletion portable/ThirdParty/GCC/Posix/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/* *INDENT-ON* */

#include <limits.h>
#include <stdint.h>

/*-----------------------------------------------------------
* Port specific definitions.
Expand Down Expand Up @@ -126,7 +127,7 @@ extern void vPortCancelThread( void *pxTaskToDelete );
*/
#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )

extern unsigned long ulPortGetRunTime( void );
extern uint32_t ulPortGetRunTime( void );
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() /* no-op */
#define portGET_RUN_TIME_COUNTER_VALUE() ulPortGetRunTime()

Expand Down

0 comments on commit cfd4c73

Please sign in to comment.