NagyDonat wrote:

> The "Misc/warning-flags.c" tells that all new warnings should have a `-W` 
> option. Is this option needed for **clang-extdef-mapping** [... ? ]

As this warning is (if I understand correctly) only emitted by 
`clang-extdef-mapping`, the corresponding `-W` command line option should not 
appear when the clang compiler prints the "normal" `-W` options.

If the `-W` option corresponding to this warning doesn't pollute the list of 
"normal" options, then its existence does not matter. Feel free to introduce it 
if that's the easier to implement, but if it doesn't exist that is also fine.

> [...] or the warning should be printed in other way (not using the diagnostic 
> API?) ?

There is a way to introduce "custom" warnings (and other custom diagnostics) 
that are not listed in a static `.td` file (and I presume don't need to have a 
`-W` option), but can be still emitted the same way as the "regular" 
diagnostics.

In particular, all reports emitted by Clang Tidy use this custom diagnostic API 
with calls like `DiagEngine->getDiagnosticIDs()->getCustomDiagID( [...] )`. For 
details see `ClangTidyDiagnosticConsumer.cpp`, I think you can easily adapt 
those solutions to work around this test failure.

(Disclaimer: I'm only vaguely familiar with these APIs, so I'm not 100% 
confident in my suggestions.)

https://github.com/llvm/llvm-project/pull/222010
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to