Skip to content

[BUG] Reasoning for FreeRTOS include policy #1186

@swaldhoer

Description

@swaldhoer

Describe the bug

What's the rational for FreeRTOS - compared to other projects - different include
policy:

/* atomic.h */
#ifndef INC_FREERTOS_H
    #error "include FreeRTOS.h must appear in source files before include atomic.h"
#endif

Why not just include FreeRTOS.h? Include what you use is generally considered good pattern in C, which also makes sense.

If an analysis, unit testing tool (or what soever) needs to fake/mock something from FreeRTOS.h for e.g., when running on atomic.h, then the tool can just pass -DINC_FREERTOS_H as compiler argument.

Target

  • Development board: any
  • Instruction Set Architecture: any
  • IDE and version: any
  • Toolchain and version: any

Host

  • Host OS: any
  • Version: any

To Reproduce

  • See the source code

Expected behavior
Just include what you use in source and header files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions