Skip to content

Ensure macros and parameters with the same name are not repeated. #8982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 7, 2018

Conversation

bridadan
Copy link
Contributor

@bridadan bridadan commented Dec 5, 2018

Description

Should fix #8931.

This covers the case when a macro is set with the same name as a
parameter. Previously, the macro would be repeated on the command line,
which causes certain toolchains to break (ex. IAR assembler). Now the
config system will override the parameter's value with the macro's
value.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@bridadan
Copy link
Contributor Author

bridadan commented Dec 6, 2018

Comments added!

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

👍

@theotherjimmy
Copy link
Contributor

theotherjimmy commented Dec 6, 2018

@bridadan Is there a way we could test for this? that way we can prevent regressions.

This covers the case when a macro is set with the same name as a
parameter. Previously, the macro would be repeated on the command line,
which causes certain toolchains to break (ex. IAR assembler). Now the
config system will override the parameter's value with the macro's
value.
@bridadan bridadan force-pushed the fix_duplicate_macros branch from 0c904f4 to 990ce38 Compare December 6, 2018 16:32
@bridadan bridadan force-pushed the fix_duplicate_macros branch from 990ce38 to b8cdfc5 Compare December 6, 2018 16:37
@bridadan
Copy link
Contributor Author

bridadan commented Dec 6, 2018

Added a unit test.

Also, turns out the ConfigMacro class already does that kind of parsing of the = sign, so I just reuse that computed value (the parsing happens here: https://github.com/ARMmbed/mbed-os/blob/master/tools/config/__init__.py#L278-L287)

@cmonr
Copy link
Contributor

cmonr commented Dec 6, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 7, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@cmonr cmonr merged commit 243b9df into ARMmbed:master Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IAR support broken with Pelion DM Client during ASM
4 participants