Skip to content

[BUG] Extra semicolon in vTaskNotifyGiveFromISR and vTaskGenericNotifyGiveFromISR  #553

Description

@newbrain

Describe the bug
Spurious semicolons at the end of vTaskNotifyGiveFromISR and vTaskGenericNotifyGiveFromISR macro definitions.
Version: FreeRTOS Kernel V10.4.3 LTS Patch 2 (still present on latest commit)

Target

  • Development board: Immaterial
  • Instruction Set Architecture: Immaterial
  • IDE and version: Immaterial
  • Toolchain and version: llvm, clang 13.0, (immaterial)

Host

  • Host OS: Any
  • Version:

To Reproduce
Compile the following code as part of an ISR:

        if (condition)
            vTaskNotifyGiveFromISR(task, &yield);
        else
            xSemaphoreGiveFromISR(semaphore, &yield);

Expected behavior
Compilation should succeed.
it instead fails with:

[build] ../source/SDR/filterGeneric.c:97:9: error: expected expression
[build]         else
[build]         ^
[build] 1 error generated.

Additional Context
The problem is caused by extra semicolons at the end of vTaskNotifyGiveFromISR and vTaskGenericNotifyGiveFromISR macro definitions:

#define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) \
    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) );
#define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) \
    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) );

The semicolons terminate the statement and make them not follow the usual convention for function-like macros of behaving like an actual function, specifically making their use in a single statement then clause without braces unexpectedly not require a semicolon.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions