Details
- Reviewers
hansw
Diff Detail
Event Timeline
It doesn't look like there's a really clean mapping for these warnings from MSVC to clang. I don't want to have overly broad mappings from cl warnings to clang warnings because hopefully clang's on-by-default warnings have lower false positive rates.
If you're actually investigating cleaning up clang warnings, I recommend using the gcc style -W / -Wno flags that we expose through clang-cl. These are much finer grained.
include/clang/Driver/CLCompatOptions.td | ||
---|---|---|
131 | Doesn't this also cover integer conversion? The MSDN article makes it appear that way: We could make this -Wno-conversion, but that's a pretty big hammer. | |
test/Driver/cl-options.c | ||
167–175 | I'd combine this to speed up the test a bit. |
These are two MSVC warnings that we disable for Firefox. That's why I'm implementing them in clang-cl.
include/clang/Driver/CLCompatOptions.td | ||
---|---|---|
131 | Originally I mapped this to Wno-int-conversion too, but it seems like the support for passing more than one string to ArgList is broken (in that I was getting -Wno-float-conversion no-int-conversion passed to cc1). After applying this local LLVM patch, things worked correctly, but I'm not sure if this patch is correct or not (it doesn't break any tests, it seems.) diff --git a/lib/Option/Arg.cpp b/lib/Option/Arg.cpp index 4c8da58..c6120d8 100644 --- a/lib/Option/Arg.cpp +++ b/lib/Option/Arg.cpp @@ -107,10 +107,9 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { } case Option::RenderJoinedStyle: - Output.push_back(Args.GetOrMakeJoinedArgString( - getIndex(), getSpelling(), getValue(0))); for (unsigned i = 1, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(i)); + Output.push_back(Args.GetOrMakeJoinedArgString( + getIndex(), getSpelling(), getValue(i))); break; case Option::RenderSeparateStyle: |
Do we really want to try supporting the individual MSVC warning flags?
It will never be a clean mapping anyway, and the diagnostics won't be very nice. For example, Clang won't print the MSVC style warning names when issuing a warning.
Can't you just use the same list of enabled/disabled warning that you use with Clang on other platforms?
I'd be in favor of that.
I think we should certainly support the broad flags, like turning all warnings off, treating them as errors, etc. But for controlling individual Clang warnings, I think it makes sense to use Clang flags.
Doesn't this also cover integer conversion? The MSDN article makes it appear that way:
http://msdn.microsoft.com/en-us/library/th7a07tz.aspx
We could make this -Wno-conversion, but that's a pretty big hammer.