Skip to content

[BUG] C90 compatibility broken since release 10.4.4 #358

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

Closed
vbrzeski opened this issue Jun 22, 2021 · 3 comments
Closed

[BUG] C90 compatibility broken since release 10.4.4 #358

vbrzeski opened this issue Jun 22, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@vbrzeski
Copy link

Describe the bug
The Kernel fails to compile with C90 due to block scope on the vEventGroupDelete() function of file event_groups.c.

Target

  • Development board: Custom SBC
  • Instruction Set Architecture: C166v2
  • IDE and version: Keil uVision 5.29.0.0
  • Toolchain and version: C166 v7.57

Host

  • Host OS: Windows 10
  • Version: 1909

To Reproduce

  • Compile FreeRTOS with a C90 compiler

Expected behavior
Succesful compilation

Screenshots
image

Additional context
Looks like issues in the past may have introduced this bug: #293

Analysis & Temporary Resolution
The contract broken with the C90 standard is that variables must be declared at the top of a context block. If you're testing with GCC you may need to use the -pedantic flag to be strictly compliant. From my understanding thus far FreeRTOS still supports the C90 standard (of minus a custom stdint.h) so using the pedantic flag for your tests would be more correct.

I like to live at head, so I will just do a quick hack by placing the function in its own block context, thus the assertion can be done at the top. Here's a diff:
image

Again, thanks for the great kernel!

@vbrzeski vbrzeski added the bug Something isn't working label Jun 22, 2021
@aggarg
Copy link
Member

aggarg commented Jun 22, 2021

Would the following solve your problem:

    EventGroup_t * pxEventBits = xEventGroup;
    const List_t * pxTasksWaitingForBits;

    configASSERT( xEventGroup );

    pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );

@vbrzeski
Copy link
Author

Compiles! Thanks.

aggarg added a commit to aggarg/FreeRTOS-Kernel that referenced this issue Jun 22, 2021
This issue was reported here: FreeRTOS#358

Signed-off-by: Gaurav Aggarwal <[email protected]>
aggarg added a commit that referenced this issue Jun 23, 2021
This issue was reported here: #358

Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg
Copy link
Member

aggarg commented Jun 23, 2021

I merged the fix. Thank you for reporting the issue.

@aggarg aggarg closed this as completed Jun 23, 2021
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this issue Apr 18, 2024
…TOS#358)

Because the const qualifier was removed in PR FreeRTOS#356, coreMQTT also needs to be updated to remove it.
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

2 participants