This is an archive of the discontinued LLVM Phabricator instance.

[MSVC Compat] Only warn for unknown clang-cl arguments
ClosedPublic

Authored by ehsan on Jan 23 2016, 10:34 AM.

Details

Summary

MSVC's driver accepts all unknown arguments but warns about them. clang
by default rejects all unknown arguments. This causes issues
specifically with build systems such as autoconf which liberally pass
things such as $LDFLAGS to the compiler and expect everything to work.
This patch teaches clang-cl to ignore unknown driver arguments.

Diff Detail

Repository
rL LLVM

Event Timeline

ehsan updated this revision to Diff 45796.Jan 23 2016, 10:34 AM
ehsan retitled this revision from to [MSVC Compat] Only warn for unknown clang-cl arguments.
ehsan updated this object.
ehsan added a reviewer: rnk.
ehsan added a subscriber: cfe-commits.
rnk accepted this revision.Jan 25 2016, 10:42 AM
rnk edited edge metadata.

lgtm other than the warning group.

test/Misc/warning-flags.c
21 ↗(On Diff #45796)

This list shouldn't grow, we should have a warning group for this. -W[no-]unknown-argument sounds good to me.

This revision is now accepted and ready to land.Jan 25 2016, 10:42 AM
hans added a subscriber: hans.Jan 25 2016, 11:34 AM

Maybe this behavior should be called out in the Command-Line Options section under clang-cl in docs/UsersManual.rst?

Thanks for the reviews! Will address both when landing.

This revision was automatically updated to reflect the committed changes.