Skip to content
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

[SR-7040] Provide a helpful diagnostic when a -D flag starts with a redundant -D #49588

jckarter opened this issue Feb 20, 2018 · 1 comment


Copy link

@jckarter jckarter commented Feb 20, 2018

Previous ID SR-7040
Radar None
Original Reporter @jckarter
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Driver, StarterBug
Assignee Nonchalant (JIRA)
Priority Medium

md5: 8973ac9d0601c5c599ecb97430f8bd6b

Issue Description:

Xcode (and possibly other IDEs) provide a UI over -D flags where you provide the flag name and -D is prepended for you. Users might reasonably add a redundant -D themselves, leading to the invalid flag `-D-DFOO` getting passed into the compiler. The driver could detect this and raise a specific error message alerting the user to their mistake.

Copy link
Member Author

@jckarter jckarter commented Feb 20, 2018

Possible implementation strategy: when we validate the names of build configuration flags, before raising the "conditional compilation flags must be valid Swift identifiers" error, check whether the flag name begins with "-D" and provide a specific diagnostic "did you provide a redundant '-D' in your build settings?"

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant