Infineon / XMC-for-Arduino

Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Other
103 stars 64 forks source link

map() definition conflicts with STL version #257

Closed automatiek closed 1 week ago

automatiek commented 8 months ago

Prerequisites

Can you reproduce the problem reliably?

We've seen the issue on multiple machines.

Did you check current release notes for known issues?

yes

If this is not the latest release, have you checked newer releases?

Description:

In the core drivers of the xmc for Arduino package there's a macro definition named map(). See here. This name collides with the map() function from vector defined in the STL libraries in ARM. In the examples provided vector is not included, when it is included the compiler errors out.

A clear and concise description of what the bug is.

Steps to Reproduce:

  1. Select the XMC4700 Relax kit and open the SleepModeXMC4700 example

  2. Build to verify it works.

  3. Add #include <vector> at the top of the include list and click build.

Expected Result:

All good

Actual Result:

In file included from /Users/arjan/Library/Arduino15/packages/Infineon/hardware/xmc/2.2.0/cores/Arduino.h:300,
                 from sketch/SleepModeXMC4700.ino.cpp:1:
/Users/arjan/Library/Arduino15/packages/Infineon/hardware/xmc/2.2.0/cores/wiring_constants.h:77: note: macro "max" defined here
   77 | #define max(a,b) ((a)>(b)?(a):(b))
      |
      exit status 1

Frequency (1/1, 1/50, 1/100):

Don't know

Build/Commit:

Please specify the release, like 1.4.1. If there is no release, give us the commit for the code you used.

2.2.0

Target:

XMC4700 (but probably fails on all) The chip or kit you are working with

Host OS and Version:

MacOS 13.4.1

Compiler:

Include the version! yes -> 10.3-2021

Environment

Provide the context surrounding this problem. Perhaps an IDE, a debug probe, an RTOS, etc. (and versions) Nothing special, building from Arduino IDE, using arduino-cli results in the same error

THANKS!
github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open more than 6 weeks with no activity. Please comment on this issue if it's still relevant or it will be closed automatically after 1 week.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 1 week with no activity.