Skip to content

__STDC_LIMIT_MACROS in critical.h #3276

Closed
@micromint

Description

@micromint

Description


Question

Should __STDC_LIMIT_MACROS be reinstated in critical.h?

When using a C++ compiler __STDC_LIMIT_MACROS should be declared to use datatype limit macros from stdint.h, such as the UINT32_MAX used in platform/mbed_critical.c. This declaration was added to hal/common/critical.c in #1920, but was removed when the mbed code was reorganized and declarations in critical.c moved to platform/critical.h. Should it be reinstated?

mbed_critical.c appears to be the only C source file in the mbed base library that does not build properly with a C++ compiler, e.g. using --cpp in ARMCC.

#define __STDC_LIMIT_MACROS
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>

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