How to suppress an inspection globaly / for the whole project when it is not listed?

已回答

This has been asked here without success here.

Since a large number of files in my project get flagged due to CPP-16347

I can wrap each file with

#pragma clang diagnostic push
#pragma ide diagnostic ignored "err_typecheck_invalid_operands"
....
#pragma clang diagnostic pop

However, is there a way to disable this for the whole project or globally?

'Alt+Enter" -> Inspection Other cpp options -> Edit inspection settings

takes me to whatever the last setting I modified there, i.e. nothing specific.

Is there a way to disable this inspection and this inspection only?

In general, are ""err_xxx" errors CLion specific or related to clang?

Thanks

 

 

0

Hello!

Unfortunately, not all inspections can be disabled. E.g. those detecting errors like in your case - can't. 

>In general, are ""err_xxx" errors CLion specific or related to clang?

The error about invalid operands can be shown either by CLion's own language engine, or by clangd. Actually, I can't see these errors in your code with clangd server enabled. I've added some code with the real "invalid operands" error, and with clangd server enabled it looks as follows:

With clangd server disabled:

 

0

Thanks for looking into this. You are right that the errors disappear with clangd disabled. I forgot to mention that I noticed these when I did "Code -> Inspect Code -> Whole Project". Will ignore these for now.

0

>You are right that the errors disappear with clangd disabled.

When you say "clangd disabled", in what state is the following option?

Actually, you shouldn't see the errors when clangd is enabled (the option is checked).

>I forgot to mention that I noticed these when I did "Code -> Inspect Code -> Whole Project".

"Code -> Inspect Code" always uses CLion's own language engine, it doesn't use clangd.

0

Yes, my mistake, errors disappear when clangd is enabled.

0

请先登录再写评论。