Skip to content

Bad #if in GCC ARMCM0 port  #1

Closed
@dc42

Description

@dc42

File FreeRTOS-Kernel/portable/GCC/ARM_CM0/port.c contains two instances of the following #if directive:

#if !defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

This makes no sense at all, because if __ARMCC_VERSION is not define then it should not be tested (and the subsequent test will always yield false). Also it is not MISRA-compliant, and it rightly causes a compiler warning if the gcc -Wundef compiler option is used. My guess is that it is supposed to read either:

#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

or

#if !defined (__ARMCC_VERSION) || (__ARMCC_VERSION >= 6010050)

or possibly one of these with >= replaced by <. I have replaced it by #if 0 in my copy to avoid the compiler warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions