Skip to content

[BUG] C90 compatibility broken since release 10.4.4 #358

Closed
@vbrzeski

Description

@vbrzeski

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!

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