Skip to content

[BUG] GCC/POSIX port does not compile on FreeBSD #1239

@tymmej

Description

@tymmej

Describe the bug
GCC/POSIX port does not compile on FreeBSD target. Using FreeRTOS 202406.1 LTS

Target

  • Development board: POSIX/GCC
  • Instruction Set Architecture: x86-64
  • IDE and version: none
  • Toolchain and version: clang13

Host

  • Host OS: FreeBSD
  • Version: 13.4

To Reproduce

  • Compile demo app on FreeBSD

Expected behavior
No errors during compilation.

Screenshots

../../mocks/freertos/port.c:261:23: error: expected expression
    hSigSetupThread = PTHREAD_ONCE_INIT;
                      ^
/usr/include/pthread.h:97:27: note: expanded from macro 'PTHREAD_ONCE_INIT'
#define PTHREAD_ONCE_INIT       { PTHREAD_NEEDS_INIT, NULL }
                                ^
1 error generated.

Additional context
To fix problem it is enough to add cast (pthread_once_t)PTHREAD_ONCE_INIT

On main version it looks like https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/portable/ThirdParty/GCC/Posix/port.c#L307 also needs cast.

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