Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-08-18 Thread Gerald Pfeifer
On Wed, 10 Jul 2013, Manuel López-Ibáñez wrote: This points to other ideas: 1) how about adding a helper switch to show what is included in Wall? such as -Wall-print Doesn't gcc -Q -Wall --help=warnings give you this? Yes, but...how would I know to use this? For example, gcc --help

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-12 Thread Jed Davis
On Wed, Jul 10, 2013 at 06:11:11PM +0200, Andi Kleen wrote: FWIW basically -Werror -Wall defines a compiler version specific variant of C. May be great for individual developers, but it's always a serious mistake in any distributed Makefile. Not always. Any project large enough (or serious

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-11 Thread Gabriel Dos Reis
On Thu, Jul 11, 2013 at 12:42 AM, Ryan Hill dirtye...@gentoo.org wrote: On Wed, 10 Jul 2013 07:49:18 -0500 Gabriel Dos Reis g...@integrable-solutions.net wrote: If we include a warning in -Wall then it is because we believe it to be generally useful and likely to uncover common bugs/mistakes.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-11 Thread Andreas Arnez
Jeff Law l...@redhat.com writes: On 07/10/2013 04:51 AM, Andreas Arnez wrote: OK, I may be biased, because I have *only* seen false positives with this warning so far. Others may have made better experience with it. It's found numerous bugs across many projects. The reduction in bug

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-11 Thread Jakub Jelinek
On Thu, Jul 11, 2013 at 11:11:28AM +0200, Andreas Arnez wrote: On 07/10/2013 04:51 AM, Andreas Arnez wrote: OK, I may be biased, because I have *only* seen false positives with this warning so far. Others may have made better experience with it. It's found numerous bugs across many

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-11 Thread Michael Matz
Hi, On Thu, 11 Jul 2013, Gabriel Dos Reis wrote: Arg, no. -Werror is very useful for development and I'm sure that code quality increases because of it, but it should never be enabled by default for releases. I think about 80% of the bugs we've had filed so far for packages failing

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andreas Arnez
Jeff Law l...@redhat.com writes: On 07/09/2013 07:56 AM, Andreas Arnez wrote: Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andreas Arnez
Tom Tromey tro...@redhat.com writes: gdb only enables it for the development branch, not for releases. If you're building from CVS you're expected to know how to either fix these problems or disable -Werror. Typically the fix is trivial; if you look through the archives you'll see fixes

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Tue, Jul 9, 2013 at 4:57 PM, Jeff Law l...@redhat.com wrote: I personally like -Wall -Werror. While we do run into false positives and the set of false positives does change from release to release as a result of optimizations, I believe there's been an overall improvement in the quality

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andi Kleen
Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror successfully for many years are now forced to

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Paul_Koning
On Jul 10, 2013, at 10:42 AM, Andi Kleen wrote: Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Jeff Law
On 07/10/2013 04:51 AM, Andreas Arnez wrote: Jeff Law l...@redhat.com writes: OK, I may be biased, because I have *only* seen false positives with this warning so far. Others may have made better experience with it. It's found numerous bugs across many projects. The reduction in bug reports

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Wed, Jul 10, 2013 at 9:42 AM, Andi Kleen a...@firstfloor.org wrote: Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andi Kleen
No. People expect that -Werror turns warnings into errors. That is what we have documented for years. Starting to special case these things is a royal road to confusion, and a slippery slope. Ok, I will keep removing -Werrors from Makefiles then. FWIW basically -Werror -Wall defines a

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andrew Haley
On 07/10/2013 05:11 PM, Andi Kleen wrote: FWIW basically -Werror -Wall defines a compiler version specific variant of C. May be great for individual developers, but it's always a serious mistake in any distributed Makefile. I could not have put it any better. Andrew.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Jonathan Wakely
On 10 July 2013 17:11, Andi Kleen wrote: FWIW basically -Werror -Wall defines a compiler version specific variant of C. May be great for individual developers, but it's always a serious mistake in any distributed Makefile. That's a very nice way to put it.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Jakub Jelinek
On Wed, Jul 10, 2013 at 07:42:55AM -0700, Andi Kleen wrote: Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Jeff Law
On 07/10/2013 10:29 AM, Jonathan Wakely wrote: On 10 July 2013 17:11, Andi Kleen wrote: FWIW basically -Werror -Wall defines a compiler version specific variant of C. May be great for individual developers, but it's always a serious mistake in any distributed Makefile. That's a very nice way

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Paul_Koning
On Jul 10, 2013, at 12:44 PM, Jeff Law wrote: On 07/10/2013 10:29 AM, Jonathan Wakely wrote: On 10 July 2013 17:11, Andi Kleen wrote: FWIW basically -Werror -Wall defines a compiler version specific variant of C. May be great for individual developers, but it's always a serious mistake in

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andrew Haley
On 07/10/2013 05:48 PM, paul_kon...@dell.com wrote: It seems to me there are two cases. One is releases, where you want to maximize the odds that an install will work. For that you clearly don't want -Werror, and you might want to trim back the warnings. The other is the development

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Xinliang David Li
What about introducing a new blanket warning kind that excludes anything with false positives? something like -WALL ? David On Wed, Jul 10, 2013 at 3:51 AM, Andreas Arnez ar...@linux.vnet.ibm.com wrote: Jeff Law l...@redhat.com writes: On 07/09/2013 07:56 AM, Andreas Arnez wrote: Andrew

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Wed, Jul 10, 2013 at 2:01 PM, Xinliang David Li davi...@google.com wrote: What about introducing a new blanket warning kind that excludes anything with false positives? something like -WALL ? I am doubtful more ropes is the answer. -- Gaby

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Xinliang David Li
On Wed, Jul 10, 2013 at 12:05 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Wed, Jul 10, 2013 at 2:01 PM, Xinliang David Li davi...@google.com wrote: What about introducing a new blanket warning kind that excludes anything with false positives? something like -WALL ? I am

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Wed, Jul 10, 2013 at 2:27 PM, Xinliang David Li davi...@google.com wrote: On Wed, Jul 10, 2013 at 12:05 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Wed, Jul 10, 2013 at 2:01 PM, Xinliang David Li davi...@google.com wrote: What about introducing a new blanket warning kind

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Xinliang David Li
There are two fundamental problems: 1) uninit warning has false positives. 2) people disagree what is the expected behavior of -Wall. 1) can only be solved by improving the analysis. The new option is a reasonable way to solve 2), unless you think the only way to solve it is to change the

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Andi Kleen
Xinliang David Li davi...@google.com writes: What about introducing a new blanket warning kind that excludes anything with false positives? something like -WALL ? This still doesn't help if any new compiler version could ever add a new warning. -Andi -- a...@linux.intel.com -- Speaking for

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Wed, Jul 10, 2013 at 2:49 PM, Xinliang David Li davi...@google.com wrote: There are two fundamental problems: 1) uninit warning has false positives. 2) people disagree what is the expected behavior of -Wall. 1) can only be solved by improving the analysis. I think we should focus on this.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Xinliang David Li
On Wed, Jul 10, 2013 at 1:20 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Wed, Jul 10, 2013 at 2:49 PM, Xinliang David Li davi...@google.com wrote: There are two fundamental problems: 1) uninit warning has false positives. 2) people disagree what is the expected behavior of

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Manuel López-Ibáñez
This points to other ideas: 1) how about adding a helper switch to show what is included in Wall? such as -Wall-print Doesn't gcc -Q -Wall --help=warnings give you this? Otherwise, I think it is a bug. 2) how about making -Wall configurable -- a default config file is looked at by the

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Xinliang David Li
On Wed, Jul 10, 2013 at 2:37 PM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: This points to other ideas: 1) how about adding a helper switch to show what is included in Wall? such as -Wall-print Doesn't gcc -Q -Wall --help=warnings give you this? Yes it does work as expected.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Gabriel Dos Reis
On Wed, Jul 10, 2013 at 4:37 PM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: To be honest, I agree with Gabriel here. And I would go a step forward, I would say that we are too timid with the warnings we enable by default or by -Wall. We should warn more agressively, and let users

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-10 Thread Ryan Hill
On Wed, 10 Jul 2013 07:49:18 -0500 Gabriel Dos Reis g...@integrable-solutions.net wrote: If we include a warning in -Wall then it is because we believe it to be generally useful and likely to uncover common bugs/mistakes. It is therefore reasonable for users to issue -Wall -Werror even in

Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Andreas Arnez
When building gdb with newer gcc versions I frequently stumble across maybe-uninitialized false positives, like the ones documented in bug 57237. Various bugs address similar issues, and in bug 56526 Jakub Jelinek wrote: Maybe-uninitialized warnings have tons of known false positives, while

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Andrew Haley
On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror successfully for many years are now forced to investigate non-existing bugs in their code.

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Jonathan Wakely
On 9 July 2013 13:04, Andrew Haley wrote: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror successfully for many years are now forced to

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Andrew Haley
On 07/09/2013 02:56 PM, Andreas Arnez wrote: What matters is whether *some* stages of production code development use this combination of options. It could certainly be argued whether it should also be a project's configure default, like currently the case for gdb. It's not a problem for GDB

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Andreas Arnez
Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror successfully for many years are now forced to

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Tom Tromey
Andrew I would question the appropriateness of using -Wall -Werror in Andrew production code. Andreas What matters is whether *some* stages of production code Andreas development use this combination of options. It could Andreas certainly be argued whether it should also be a project's Andreas

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-09 Thread Jeff Law
On 07/09/2013 07:56 AM, Andreas Arnez wrote: Andrew Haley a...@redhat.com writes: On 07/09/2013 12:59 PM, Andreas Arnez wrote: With this situation at hand, I wonder whether it's a good idea to keep maybe-uninitialized included in -Wall. Projects which have been using -Wall -Werror