Skip to content

min and max definitions in Arduino.h cause compilation errors #12

Open
@pdcook

Description

@pdcook

Any project which uses std::unordered_map fails to compile. The error message is extraordinarily long, but starts as:

rom /home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/bits/hashtable.h:35,
                 from /home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/unordered_map:46,
/home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/limits:1818:7: error: 'constexpr' static data member 'max' must have an initializer
 1818 |       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
      |       ^~~
/home/pcook/.arduino15/packages/h2zero/tools/gcc-arm-none-eabi/9.3.1-1/arm-none-eabi/include/c++/9.3.1/limits:1818:7: error: expected ';' at end of member declaration
 1818 |       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
      |       ^~~
      |          ;

I hope this is just something I'm doing wrong. An identical project using the non-n-able core compiles without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions