Skip to content

Conversation

@sebromero
Copy link

This PR removes the superfluous prefix from the boards configuration which results in pre-compiler defines that have a duplicate ARDUINO_ prefix. To verify, enable verbose output in the IDE and you will see all the generated defines.

@sebromero sebromero requested a review from pennam October 29, 2025 15:36
Copy link
Collaborator

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with this change is that, in addition to the -DARDUINO_{build.board} that produces the superfluous prefix on the macro definitions, the compilation patterns also contain -D{build.board}. It is nice to use a prefix on global macro definitions to create a "namespace".

A generic macro name like GIGA seems prone to name collisions.

@per1234 per1234 added the enhancement New feature or request label Oct 29, 2025
@pillo79
Copy link

pillo79 commented Oct 30, 2025

A generic macro name like GIGA seems prone to name collisions.

Indeed that was the reasoning behind the choice: better to have an extra ARDUINO_ARDUINO_GIGA than a very generic version. Everyone should use ARDUINO_GIGA anyway.

@pennam
Copy link

pennam commented Oct 30, 2025

A generic macro name like GIGA seems prone to name collisions.

Indeed that was the reasoning behind the choice: better to have an extra ARDUINO_ARDUINO_GIGA than a very generic version. Everyone should use ARDUINO_GIGA anyway.

why not also remove -D{build.board} to get rid of GIGA and keep only ARDUINO_GIGA. ARDUINO_ARDUINO_GIGA looks also wrong in my opinion.

@sebromero
Copy link
Author

Totally agree with @pennam . If we don't want the board-only macro, let's remove it from the build process. @pillo79 You suggested to use the board name only without the prefix, that's why I made this PR 🙂

@pillo79
Copy link

pillo79 commented Oct 30, 2025

A generic macro name like GIGA seems prone to name collisions.

Indeed that was the reasoning behind the choice: better to have an extra ARDUINO_ARDUINO_GIGA than a very generic version. Everyone should use ARDUINO_GIGA anyway.

why not also remove -D{build.board} to get rid of GIGA and keep only ARDUINO_GIGA. ARDUINO_ARDUINO_GIGA looks also wrong in my opinion.

EPIC FACEPALM!
I was absolutely sure it was done by the CLI somehow. Turns out there is no real reason but "always been this way". +1 from @facchinm as well on removing the prefixes and the -D{build.board}, so @sebromero please remove that from the platform.txt as well.

@sebromero sebromero merged commit 661a316 into arduino:main Oct 30, 2025
24 checks passed
@sebromero sebromero deleted the board-identifiers branch October 30, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants