[PATCH] D63423: [Diagnostics] Diagnose misused xor as pow

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 11:06:38 PDT 2019


lebedev.ri added a comment.

In D63423#1550728 <https://reviews.llvm.org/D63423#1550728>, @jfb wrote:

> In D63423#1550725 <https://reviews.llvm.org/D63423#1550725>, @lebedev.ri wrote:
>
> > I've always been frustrated at how clang just gives up as soon as it sees a macro.
> >  At best that should be controlled with some command-line flag.
>
>
> This patch is not the place to change common clang behavior. I'm advocating for what we usually do: be conservative in macros because token-pasting tends to look "wrong" but not actually be wrong as much (i.e. false positives). If you want clang to do something different, an RFC to cfe-dev is the right place for such a discussion.


I don't think i'm proposing to change the entirety of warnings to warn on macros, am i?
Likewise, is it a causality/practice to ignore macros, or a documented requirement [that would require RFC for changing]?
It's been awhile since i've read through the entirety of docs, but i don't recall seeing one.

In D63423#1550732 <https://reviews.llvm.org/D63423#1550732>, @xbolva00 wrote:

> In D63423#1550725 <https://reviews.llvm.org/D63423#1550725>, @lebedev.ri wrote:
>
> > I've always been frustrated at how clang just gives up as soon as it sees a macro.
> >  At best that should be controlled with some command-line flag.
>
>
> I cannot promise nothing, but maybe I could do -Wxor-used-as-pow-in-macro (off by default) so people could try it and see how noisy it would be :)


I'm not sure `-Wflag` + `-Wflag-in-macros` will scale :/
i was thinking more along the lines of warn-for-system-headers flag.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63423/new/

https://reviews.llvm.org/D63423





More information about the cfe-commits mailing list