Ignoring compiler warnings without ignoring the group

Hello all,

Clang has wonderful diagnostics! Unfortunately when you enable them on a code-base of several years old, a lot get triggered. In order to phase the path to a better world, we have all warnings enabled (as error).
With this, we disable (and document) the warnings we don’t want and keep track of those not yet investigated.

For example:
#pragma clang diagnostic ignored “-Wparentheses” // using the result of an assignment as a condition without parentheses

However, when removing this line, I get the following warning:
error: ‘&&’ within ‘||’ [-Werror,-Wlogical-op-parentheses]

I’m aware of the ‘diagnostic groups’, which is causing this.

However, I do am wondering if their is a way to disable these groups and indicate that we only want the warning ignored without the elements in that group.

Any suggestions?

I don’t believe there’s a way to do that (disable diagnostics from a group, but keep any subgroups enabled (or the opposite, I guess, etc)) - but it does seem like a nice feature request/thing to think about.

I don’t believe there’s a way to do that (disable diagnostics from a group, but keep any subgroups enabled (or the opposite, I guess, etc)) - but it does seem like a nice feature request/thing to think about.

That would lose the important property that we can spilt a warning up into subgroups in a backwards-compatible way.

Perhaps instead we should aim to add sufficient subgroups so that there are no warning flags that contain both warnings and subgroups?

I don’t believe there’s a way to do that (disable diagnostics from a group, but keep any subgroups enabled (or the opposite, I guess, etc)) - but it does seem like a nice feature request/thing to think about.

That would lose the important property that we can spilt a warning up into subgroups in a backwards-compatible way.

Ah - makes sense, yeah.

Perhaps instead we should aim to add sufficient subgroups so that there are no warning flags that contain both warnings and subgroups?

Sounds like it’d work, yeah. If that seems reasonable to you, etc. Though a fair bit of cleanup (& naming - hard problem & all) work.