Ignoring compiler warnings without ignoring the group

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

Ignoring compiler warnings without ignoring the group

via cfe-dev
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?


JVApen

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Ignoring compiler warnings without ignoring the group

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

On Sat, Oct 13, 2018 at 9:51 AM JVApen via cfe-dev <[hidden email]> wrote:
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?


JVApen
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Ignoring compiler warnings without ignoring the group

via cfe-dev
On Sat, 13 Oct 2018, 18:39 David Blaikie via cfe-dev <[hidden email] wrote:
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?

On Sat, Oct 13, 2018 at 9:51 AM JVApen via cfe-dev <[hidden email]> wrote:
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?


JVApen
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Ignoring compiler warnings without ignoring the group

via cfe-dev


On Sat, Oct 13, 2018 at 8:23 PM Richard Smith <[hidden email]> wrote:
On Sat, 13 Oct 2018, 18:39 David Blaikie via cfe-dev <[hidden email] wrote:
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.
 

On Sat, Oct 13, 2018 at 9:51 AM JVApen via cfe-dev <[hidden email]> wrote:
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?


JVApen
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev