Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch of parameters in macro ulTaskNotifyTakeIndexed causes compilation error #175

Closed
cobusve opened this issue Sep 17, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@cobusve
Copy link
Member

cobusve commented Sep 17, 2020

Describe the bug
This issue was first reported on the FreeRTOS forums here https://forums.freertos.org/t/task-h-error-uxindextonotify-undeclared/10689

The macro ulTaskNotifyTakeIndexed was introduced with FreeRTOS 10.4.0. The implementation of the macro had a mismatch between the named macro parameters and the use of these parameters in the macro as follows:

As this macro was only introduced in V10.4.0 and the failure is at compile time we consider the potential risk from this bug to be very limited.

The offending code is shown here

  
#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait )
ulTaskGenericNotifyTake( ( uxIndexToNotify ), ( xClearCountOnExit ), ( xTicksToWait ) )
  

To Reproduce

  • Use the new macro ulTaskNotifyTakeIndexed as described in the forum post and you will observe a compilation error.

Additional context

The test code for this macro unfortunately had a local variable named uxIndexToNotify which masked the error during testing. The test was using this variable to pass the value into the macro which resulted in correct behavior because the variable name in the test was an exact match to the variable name incorrectly used in the macro implementation.

See this location for the exact code
https://github.com/FreeRTOS/FreeRTOS/blob/89d475e9b112d7b52c3d16aeff97e1e8e6b95316/FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c#L954

@cobusve cobusve added the bug Something isn't working label Sep 17, 2020
@cobusve cobusve changed the title Mismatch of parameters in macro ulTaskNotifyTakeIndexed Mismatch of parameters in macro ulTaskNotifyTakeIndexed causes compilation error Sep 17, 2020
@cobusve
Copy link
Member Author

cobusve commented Sep 17, 2020

This has been fixed in V10.4.1

@cobusve cobusve closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant