FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.76k stars 1.12k forks source link

Conversion warnings causing posix gcc build to fail [BUG] #826

Closed cmorganBE closed 1 year ago

cmorganBE commented 1 year ago

Describe the bug

FreeRTOS-Kernel abb5452a12ebff8e8af640e3ceb5fe16f30e6f54 (main as of 2023-10-10).

Building the posix gcc demo on x86-64 linux (Ubuntu 23.04).

~/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/build$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/build
[  1%] Building C object FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/ThirdParty/GCC/Posix/port.c.o
[  2%] Building C object FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/ThirdParty/GCC/Posix/utils/wait_for_event.c.o
[  4%] Linking C static library libfreertos_kernel_port.a
[  4%] Built target freertos_kernel_port
[  5%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/croutine.c.o
[  7%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/event_groups.c.o
[  8%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/list.c.o
[ 10%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/queue.c.o
[ 11%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/stream_buffer.c.o
[ 13%] Building C object FreeRTOS-Kernel/CMakeFiles/freertos_kernel.dir/tasks.c.o
In file included from /home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/./FreeRTOSConfig.h:157,
                 from /home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/include/./FreeRTOS.h:64,
                 from /home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:39:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c: In function ‘xTaskDelayUntil’:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:2180:40: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 2180 |                 traceTASK_DELAY_UNTIL( xTimeToWake );
      |                                        ^~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcRecorder.h:812:63: note: in definition of macro ‘trcKERNEL_HOOKS_TASK_DELAY’
  812 |         prvTraceStoreKernelCallWithNumericParamOnly( SERVICE, xValue );                \
      |                                                               ^~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:2180:17: note: in expansion of macro ‘traceTASK_DELAY_UNTIL’
 2180 |                 traceTASK_DELAY_UNTIL( xTimeToWake );
      |                 ^~~~~~~~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c: In function ‘vTaskDelay’:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h:1348:59: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 1348 |     trcKERNEL_HOOKS_TASK_DELAY( TASK_DELAY, pxCurrentTCB, xTicksToDelay ); \
      |                                                           ^~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcRecorder.h:812:63: note: in definition of macro ‘trcKERNEL_HOOKS_TASK_DELAY’
  812 |         prvTraceStoreKernelCallWithNumericParamOnly( SERVICE, xValue );                \
      |                                                               ^~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:2227:17: note: in expansion of macro ‘traceTASK_DELAY’
 2227 |                 traceTASK_DELAY();
      |                 ^~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c: In function ‘xTaskIncrementTick’:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h:1264:123: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 1264 | hedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE ) { trcKERNEL_HOOKS_NEW_TIME( DIV_NEW_TIME, xTickCount + 1 ); }

/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcRecorder.h:787:59: note: in definition of macro ‘trcKERNEL_HOOKS_NEW_TIME’
  787 |     prvTraceStoreKernelCallWithNumericParamOnly( SERVICE, xValue );
      |                                                           ^~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:4397:5: note: in expansion of macro ‘traceTASK_INCREMENT_TICK’
 4397 |     traceTASK_INCREMENT_TICK( xTickCount );
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c: In function ‘vTaskPlaceOnEventListRestricted’:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:5025:45: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 5025 |         traceTASK_DELAY_UNTIL( ( xTickCount + xTicksToWait ) );
      |                                ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcRecorder.h:812:63: note: in definition of macro ‘trcKERNEL_HOOKS_TASK_DELAY’
  812 |         prvTraceStoreKernelCallWithNumericParamOnly( SERVICE, xValue );                \
      |                                                               ^~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:5025:9: note: in expansion of macro ‘traceTASK_DELAY_UNTIL’
 5025 |         traceTASK_DELAY_UNTIL( ( xTickCount + xTicksToWait ) );
      |         ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcRecorder.h:71:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c: In function ‘xTaskGenericNotifyWait’:
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h:1788:129: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 1788 | elCallWithParam( TRACE_TASK_NOTIFY_WAIT_TRCBLOCK, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER( pxCurrentTCB ), xTicksToWait ); \
      |                                                                                                            ^~~~~~~~~~~~

/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:7324:21: note: in expansion of macro ‘traceTASK_NOTIFY_WAIT_BLOCK’
 7324 |                     traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWaitOn );
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h:1769:124: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 1769 | StoreKernelCallWithParam( TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER( pxCurrentTCB ), xTicksToWait );           \
      |                                                                                                            ^~~~~~~~~~~~

/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:7346:13: note: in expansion of macro ‘traceTASK_NOTIFY_WAIT’
 7346 |             traceTASK_NOTIFY_WAIT( uxIndexToWaitOn );
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Demo/Posix_GCC/../../../FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h:1771:134: error: conversion from ‘TickType_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
 1771 | lCallWithParam( TRACE_TASK_NOTIFY_WAIT_TRCFAILED, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER( pxCurrentTCB ), xTicksToWait ); \
      |                                                                                                            ^~~~~~~~~~~~

/home/cmorgan/projects/freertos-task-create-test/FreeRTOS/FreeRTOS/Source/tasks.c:7346:13: note: in expansion of macro ‘traceTASK_NOTIFY_WAIT’
 7346 |             traceTASK_NOTIFY_WAIT( uxIndexToWaitOn );
      |             ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Target / Host

To Reproduce

Expected behavior Build without errors.

Screenshots None at present.

Additional context N/A

tony-josi-aws commented 1 year ago

@cmorganBE, thanks for taking the time to report this. These warnings are generated because the FreeRTOS repo is using an old version of Tracelyzer library.

rawalexe commented 1 year ago

We are updating our code to use the latest version of Tracelyzer library the PR is can be found here

rawalexe commented 1 year ago

Hello @cmorganBE, The PR has been merged and this should solve this problem, I'm closing this issue for now, please feel free to reach out if you have further concerns or queries.

Thank you AR