Clang-cl - errors and warning messages slightly different from MSVC

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang-cl - errors and warning messages slightly different from MSVC

James Y Knight via cfe-dev
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.

Many thanks for your time.
--
Marco Craveiro

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

MD, Domain Driven Consulting
about: http://about.me/marcocraveiro
blog: http://mcraveiro.blogspot.co.uk
twitter: https://twitter.com/MarcoCraveiro

That the Ideas are themselves manifestations (of the Idea-Idea) and
that the Idea-Idea is a-kind-of Manifestation-Idea—which is a-kind-of
itself, so that the system is completely self-describing— would have
been appreciated by Plato as an extremely practical joke [Plato]. --
Alan Key
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang-cl - errors and warning messages slightly different from MSVC

James Y Knight via cfe-dev
> Basically, it boils down to the introduction of an extra space after "error" and "warning" in Clang-cl, when compared to MSVC [2].

Apologies, meant to say before, i.e. instead of ": warning ", I see ":
 warning ". Same for errors.
--
Marco Craveiro

MD, Domain Driven Consulting
about: http://about.me/marcocraveiro
blog: http://mcraveiro.blogspot.co.uk
twitter: https://twitter.com/MarcoCraveiro

That the Ideas are themselves manifestations (of the Idea-Idea) and
that the Idea-Idea is a-kind-of Manifestation-Idea—which is a-kind-of
itself, so that the system is completely self-describing— would have
been appreciated by Plato as an extremely practical joke [Plato]. --
Alan Key
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang-cl - errors and warning messages slightly different from MSVC

James Y Knight via cfe-dev
In reply to this post by James Y Knight via cfe-dev
On Mon, Feb 18, 2019 at 6:20 PM Marco Craveiro via cfe-dev
<[hidden email]> 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
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang-cl - errors and warning messages slightly different from MSVC

James Y Knight via cfe-dev
<whitespace differences in error reporting>
> 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!

No problems!

> 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

You're a superstar Hans, thanks very much for the quick turnaround.

> 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.

I'll have a chat with the CDash devs, now the problem is understood
maybe they will be OK with such a patch.

Thanks very much.
--
Marco Craveiro

MD, Domain Driven Consulting
about: http://about.me/marcocraveiro
blog: http://mcraveiro.blogspot.co.uk
twitter: https://twitter.com/MarcoCraveiro

That the Ideas are themselves manifestations (of the Idea-Idea) and
that the Idea-Idea is a-kind-of Manifestation-Idea—which is a-kind-of
itself, so that the system is completely self-describing— would have
been appreciated by Plato as an extremely practical joke [Plato]. --
Alan Key
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev