-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Fix Issue 13292 - DMD accepts both -m32 and -m64 #11058
Conversation
|
Thanks for your pull request and interest in making D better, @wolframw! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11058" |
4dc13ab to
f7d0d51
Compare
|
I did not expect destroying other tests with this change... I'll have a look on it later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this because it's pretty common to allow flags to override previous flags. E.g. gcc allows both -m32 -m64 and other dmd flags can be specified mutliple times as well (e.g. -checkaction=C -checkaction=context)
| #!/usr/bin/env bash | ||
|
|
||
| $DMD -c -o- -main -m${MODEL} ${EXTRA_FILES}/minimal/object.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, every test in this test suite is compiled with -m${MODEL}
| #!/usr/bin/env bash | ||
|
|
||
| errmsg="$(! $DMD -c -o- -main -m32 -m64 ${EXTRA_FILES}/minimal/object.d 2>&1 > /dev/null)" | ||
| expected="Error: Conflicting target architectures specified: -m32 and -m64." | ||
|
|
||
| if [ "$errmsg" != "$expected" ]; then exit 1; fi | ||
|
|
||
| exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid bash tests, either convert this into a dshell test or create fail_compilation/fail13292.d with an appropriate TEST_OUTPUT section, e.g.
/*
REQUIRED_ARGS: -m32 -m64
TEST_OUTPUT:
----
Error: Conflicting target architectures specified: $?:32mscoff=-m32mscoff and -m32|32=-m32 and -m64|64=-m64 and -m32$.
----
*/
E.g. |
Do you think it's better changing the error message to a warning or just scratching this whole thing? |
Personally the latter because current behaviour is pretty common but let's see what other people think.
To quote the wiki:
|
|
"earmarked by senior contributors" and "has good impact" is exactly what makes me assume that the fix to such an issue has at least some value and will not end up in the bin (which is what I meant with "bootcamp" being similar to "preapproved"). |
|
@wolframw : Thanks for tackling this, and sorry it didn't end up being something we can merge. For reference, anyone can do triage on Bugzilla, so we might have slightly different interpretation of what it means depending on when the label was applied / who applied it. I just did a quick search and some of those issues are definitely not trivial and require deep understanding of how things work, while some other seem much simpler. |
Now raises an error when conflicting
-mXXXarguments are given.However, multiple
-mXXXare still valid, iff allXXXare the same.