Add `-Wconversion` in CMakeLists.txt (#712)

Also fix warnings generated by this flag.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
pull/713/head^2
Gaurav-Aggarwal-AWS 2 years ago committed by GitHub
parent 50b2d8fb66
commit 2cdd0e5e55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save