[PATCH] D29198: clang-cl: Warn about /U flags that look like filenames (PR31662)

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 26 14:59:07 PST 2017


hans added inline comments.


================
Comment at: include/clang/Basic/DiagnosticDriverKinds.td:252
+  InGroup<DiagGroup<"slash-u-filename">>;
+def note_use_dashdash : Note<"Use '--' to treat subsequent arguments as filenames">;
+
----------------
amccarth wrote:
> For Windows, wouldn't it make more sense to suggest using valid paths (with backslashes instead of slashes)?
> 
> What about all the other characters paths can begin with?  Shouldn't we also warn that /code/myproject will also be interpreted as /c rather than \code\myproject?
I think it's better with a suggestion that works on both platforms.

I also think users run into this more often on non-Windows.

For `/code/myproject` we will not interpret it as the `/c` option since it has to be an exact match. `/I`, `/D` and others are problematic though.

I think it's hard to fix this in general, but `/U` is the one people keep running into, so I think targeting that with a warning makes sense.


https://reviews.llvm.org/D29198





More information about the cfe-commits mailing list