[cfe-dev] Clang-cl - errors and warning messages slightly different from MSVC

Hans Wennborg via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 19 00:38:45 PST 2019


On Mon, Feb 18, 2019 at 6:20 PM Marco Craveiro via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hi Clang developers,
>
> Thanks very much for a great compiler, and in particular for the
> amazing MSVC-compatible support in Clang-cl. I bumped into an
> intriguing issue, which may have been discussed previously; if so
> apologies, as my google-fu didn't uncover any matches.
>
> The TL;DR of it is that I use clang-cl with CDash (part of the CMake
> toolset) and I noticed that there are some tiny differences in error
> reporting between Clang-cl and MSVC, causing the CDash scrapping
> regexes to fail [1]. Basically, it boils down to the introduction of
> an extra space after "error" and "warning" in Clang-cl, when compared
> to MSVC [2].
>
> I wonder if there is a rationale for these differences, and if not, if
> it is possible to remove the extra space.

Well, this is embarrassing.

Many eyes have seen these diagnostics and yet nobody noticed, or at
least bothered to report, the extra space before, so thank you very
much for raising this!

It is indeed a bug; the extra space is not supposed to be there. Our
tests should have caught this:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/diag-format.c?view=markup
however the testing tool helpfully ignored the difference in
horizontal whitespace.

The fix is here: https://reviews.llvm.org/D58377

This will of course not help users of older versions of Clang, so it
might still be a good idea to make CDash's regexes less strict about
this whitespace if possible.

Thanks,
Hans

> [1] https://github.com/Kitware/CDash/issues/733
> [2] https://github.com/Kitware/CDash/issues/733#issuecomment-464808927



More information about the cfe-dev mailing list