mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add -Wconversion
in CMakeLists.txt (#712)
Also fix warnings generated by this flag. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
50b2d8fb66
commit
2cdd0e5e55
|
@ -260,6 +260,7 @@ target_compile_options(freertos_kernel PRIVATE
|
||||||
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
|
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
|
||||||
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
|
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
|
||||||
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
|
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
|
||||||
|
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
|
||||||
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
|
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
|
||||||
|
|
||||||
# Suppressions required to build clean with clang.
|
# Suppressions required to build clean with clang.
|
||||||
|
|
|
@ -421,7 +421,7 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
|
||||||
/* pxEnd is used to mark the end of the list of free blocks and is inserted
|
/* pxEnd is used to mark the end of the list of free blocks and is inserted
|
||||||
* at the end of the heap space. */
|
* at the end of the heap space. */
|
||||||
uxAddress = ( portPOINTER_SIZE_TYPE ) ( pucAlignedHeap + xTotalHeapSize );
|
uxAddress = ( portPOINTER_SIZE_TYPE ) ( pucAlignedHeap + xTotalHeapSize );
|
||||||
uxAddress -= xHeapStructSize;
|
uxAddress -= ( portPOINTER_SIZE_TYPE ) xHeapStructSize;
|
||||||
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
|
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
|
||||||
pxEnd = ( BlockLink_t * ) uxAddress;
|
pxEnd = ( BlockLink_t * ) uxAddress;
|
||||||
pxEnd->xBlockSize = 0;
|
pxEnd->xBlockSize = 0;
|
||||||
|
|
|
@ -508,7 +508,7 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
|
||||||
configASSERT( pxEnd != NULL );
|
configASSERT( pxEnd != NULL );
|
||||||
|
|
||||||
/* Check blocks are passed in with increasing start addresses. */
|
/* Check blocks are passed in with increasing start addresses. */
|
||||||
configASSERT( xAddress > ( size_t ) pxEnd );
|
configASSERT( ( size_t ) xAddress > ( size_t ) pxEnd );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remember the location of the end marker in the previous region, if
|
/* Remember the location of the end marker in the previous region, if
|
||||||
|
@ -517,9 +517,9 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
|
||||||
|
|
||||||
/* pxEnd is used to mark the end of the list of free blocks and is
|
/* pxEnd is used to mark the end of the list of free blocks and is
|
||||||
* inserted at the end of the region space. */
|
* inserted at the end of the region space. */
|
||||||
xAddress = xAlignedHeap + xTotalRegionSize;
|
xAddress = xAlignedHeap + ( portPOINTER_SIZE_TYPE ) xTotalRegionSize;
|
||||||
xAddress -= xHeapStructSize;
|
xAddress -= ( portPOINTER_SIZE_TYPE ) xHeapStructSize;
|
||||||
xAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
|
xAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
|
||||||
pxEnd = ( BlockLink_t * ) xAddress;
|
pxEnd = ( BlockLink_t * ) xAddress;
|
||||||
pxEnd->xBlockSize = 0;
|
pxEnd->xBlockSize = 0;
|
||||||
pxEnd->pxNextFreeBlock = NULL;
|
pxEnd->pxNextFreeBlock = NULL;
|
||||||
|
|
Loading…
Reference in a new issue