public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Rename -W to -Wextra ?
@ 2002-11-01  6:40 Wheeler, Fred (Research)
  2002-11-01 11:05 ` Joe Buck
  0 siblings, 1 reply; 31+ messages in thread
From: Wheeler, Fred (Research) @ 2002-11-01  6:40 UTC (permalink / raw)
  To: 'gcc list', Fergus Henderson; +Cc: Mike Stump, Phil Edwards


> -----Original Message-----
> From: gcc list [mailto:gcc@gcc.gnu.org]
> Sent: Thursday, October 31, 2002 7:39 PM
> To: Fergus Henderson
> Cc: Mike Stump; Wheeler, Fred (Research); Phil Edwards
> Subject: Re: Rename -W to -Wextra ?
> 
> > On 03-Jun-2002, mike stump <mrs@windriver.com> wrote:
> > > > From: "Wheeler, Fred (Research)" <wheeler@crd.ge.com>
> > > > To: "'gcc@gcc.gnu.org'" <gcc@gcc.gnu.org>
> > > > Cc: "'phil@jaj.com'" <phil@jaj.com>
> > > > Date: Mon, 3 Jun 2002 10:07:20 -0400 
> > > 
> > > > I think -Wallall should add absolutely every -W* option 
> that exists
> > > > now or is added in the future.
> > > 
> > > I am more interested in a survey of 20 people that have 
> large projects
> > > that tried to use such an option and whether they thought 
> there was
> > > any use for it.
> 
> On Wed, 2002-10-30 at 20:33, Fergus Henderson wrote:
> 
> > Even if this option were not useful in large projects, it 
> would still be
> > useful when invoking gcc by hand on small code samples, IMHO.
> 
> Unfortunately some of the warning options are brain-damaged, e.g.
> -Weffc++.  The "Effective C++" warnings are ill-considered, and will
> generate tons of warnings on any code that uses the STL.

The -Wallall option will still be handy when used with some -Wno-* options.  If you don't like
-Weffc++, you can use "-Wallall -Wno-effc++".  The -Wallall option would give the user the ability to
say to the compiler: "use all of the warning options you have, except those I explicitly turn off".
This will be useful when switching between compiler versions, since new warning options get added.

Another issue is how to handle -W options that take an "argument".  I would propose including options
such as -Wid-clash-8 and -Wlarger-than-256 in the -Wallall option, with some guess at a popular
setting.  The setting could then be changed after using the -Wallall option by explicitly using the
-Wid-clash-N or -Wlarger-than-N option.

-Fred Wheeler

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-11-01  6:40 Rename -W to -Wextra ? Wheeler, Fred (Research)
@ 2002-11-01 11:05 ` Joe Buck
  0 siblings, 0 replies; 31+ messages in thread
From: Joe Buck @ 2002-11-01 11:05 UTC (permalink / raw)
  To: "Wheeler, Fred (Research)"
  Cc: 'gcc list', Fergus Henderson, Mike Stump, Phil Edwards


> Another issue is how to handle -W options that take an "argument".  I
> would propose including options such as -Wid-clash-8 and
> -Wlarger-than-256 in the -Wallall option, with some guess at a popular
> setting.  The setting could then be changed after using the -Wallall
> option by explicitly using the -Wid-clash-N or -Wlarger-than-N option.

Oh, yuk.  You're just back to the same issue that we have with -Wall.
By the options we are choosing in -Wall, we are implicitly telling people
how to program (since so many projects use -Wall).  You'd be doing the
same if you pick argument values, and you're offering no rationale for
the values you pick.

At this point, I'd say that if you're serious, propose a patch.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 11:29 ` mike stump
  2002-06-03 16:12   ` Russ Allbery
  2002-06-03 23:53   ` Fergus Henderson
@ 2002-10-31  9:34   ` Fergus Henderson
  2 siblings, 0 replies; 31+ messages in thread
From: Fergus Henderson @ 2002-10-31  9:34 UTC (permalink / raw)
  To: mike stump; +Cc: gcc, wheeler, phil

On 03-Jun-2002, mike stump <mrs@windriver.com> wrote:
> > From: "Wheeler, Fred (Research)" <wheeler@crd.ge.com>
> > To: "'gcc@gcc.gnu.org'" <gcc@gcc.gnu.org>
> > Cc: "'phil@jaj.com'" <phil@jaj.com>
> > Date: Mon, 3 Jun 2002 10:07:20 -0400 
> 
> > I think -Wallall should add absolutely every -W* option that exists
> > now or is added in the future.
> 
> I am more interested in a survey of 20 people that have large projects
> that tried to use such an option and whether they thought there was
> any use for it.

Even if this option were not useful in large projects, it would still be
useful when invoking gcc by hand on small code samples, IMHO.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  7:13       ` Kaveh R. Ghazi
                           ` (2 preceding siblings ...)
  2002-06-03 23:41         ` Fergus Henderson
@ 2002-06-21 21:45         ` David O'Brien
  3 siblings, 0 replies; 31+ messages in thread
From: David O'Brien @ 2002-06-21 21:45 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: phil, gcc, jsm28

On Mon, Jun 03, 2002 at 10:13:46AM -0400, Kaveh R. Ghazi wrote:
> Adding -Wextra as an alias for -W is fine, but IMHO removing -W is
> not.  Why invalidate people's Makefiles and configure scripts that
> have worked for a decade?  For the same reason, we should not issue a
> "deprecated" warning when using -W.

I'd *LOVE* to see a GNU autoconf script that is 10 years old that still
works with GCC 3.1.

Our experiences with GCC 3.1 in FreeBSD on 8000 3rd party apps shows just
how much 10 year old code will not compile with GCC.  Don't _even_
mention 10 year old C++ code -- don't even try.  In fact all the new
bitching about: changing search order for system directory "/usr/include"
breaks *TONS* of GNU autoconf scripts that add -I/usr/include willy
nilly.

I really don't think there is any need to worry about the thing you are
worrying about.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-04 11:41                 ` Andrea 'Fyre Wyzard' Bocci
@ 2002-06-04 12:27                   ` Phil Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-04 12:27 UTC (permalink / raw)
  To: Andrea 'Fyre Wyzard' Bocci; +Cc: Joseph S. Myers, gcc

On Tue, Jun 04, 2002 at 07:56:36PM +0200, Andrea 'Fyre Wyzard' Bocci wrote:
> At 17:35 04/06/2002 +0100, Joseph S. Myers wrote:
> >On Tue, 4 Jun 2002, Phil Edwards wrote:
> >
> > > - for --help output and in the manual, only describe -Wextra
> >
> >You need to keep docs for -W in the manual so that someone seeing a
> >reference to -W (e.g. in a Makefile) can look it up and see what that
> >option does.

As an aside, I have to wonder how

    Give -W a better name, like -Wextra.

made it into the online "suggested changes" list, since nobody seems to
want to actually change it...


> OK, but you can deprecate it in the manual, or list it for backward 
> compatibility only.

Of course.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
       [not found]               ` <Pine.LNX.4.33.0206041733540.26576-100000@kern.srcf.societi es.cam.ac.uk>
@ 2002-06-04 11:41                 ` Andrea 'Fyre Wyzard' Bocci
  2002-06-04 12:27                   ` Phil Edwards
  0 siblings, 1 reply; 31+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2002-06-04 11:41 UTC (permalink / raw)
  To: Joseph S. Myers, Phil Edwards; +Cc: gcc

At 17:35 04/06/2002 +0100, Joseph S. Myers wrote:
>On Tue, 4 Jun 2002, Phil Edwards wrote:
>
> > - for --help output and in the manual, only describe -Wextra
>
>You need to keep docs for -W in the manual so that someone seeing a
>reference to -W (e.g. in a Makefile) can look it up and see what that
>option does.


OK, but you can deprecate it in the manual, or list it for backward 
compatibility only.

.fw.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-04  8:39             ` Phil Edwards
  2002-06-04  9:33               ` Joe Buck
@ 2002-06-04  9:59               ` Joseph S. Myers
       [not found]               ` <Pine.LNX.4.33.0206041733540.26576-100000@kern.srcf.societi es.cam.ac.uk>
  2 siblings, 0 replies; 31+ messages in thread
From: Joseph S. Myers @ 2002-06-04  9:59 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc

On Tue, 4 Jun 2002, Phil Edwards wrote:

> - for --help output and in the manual, only describe -Wextra

You need to keep docs for -W in the manual so that someone seeing a
reference to -W (e.g. in a Makefile) can look it up and see what that
option does.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-04  8:39             ` Phil Edwards
@ 2002-06-04  9:33               ` Joe Buck
  2002-06-04  9:59               ` Joseph S. Myers
       [not found]               ` <Pine.LNX.4.33.0206041733540.26576-100000@kern.srcf.societi es.cam.ac.uk>
  2 siblings, 0 replies; 31+ messages in thread
From: Joe Buck @ 2002-06-04  9:33 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc

Phil writes:
> - recognize both -W and -Wextra
> - for --help output and in the manual, only describe -Wextra
> - document all the little extra things that -W[extra] currently does
> 
> i.e., print no deprecation warnings for -W, leave it in there, but don't
> advertise it anymore.  It's too confusing.

Pretty much OK, but the manual should be complete.  Perhaps -W should
be mentioned at the end as a backward-compatible synonym for -Wextra.

> I can do the above, no problem.  Right now I do not have the time to split
> out -Wextra into 20 separate options, or to split out extra_warnings into
> 20 separate variables.  However, the updates to the manual should help
> anyone who wants to do so.

I wouldn't be surprised if there are only two or three of the -W warnings
that people would like to be able to invoke seperately.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 22:54           ` Joe Buck
@ 2002-06-04  8:39             ` Phil Edwards
  2002-06-04  9:33               ` Joe Buck
                                 ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-04  8:39 UTC (permalink / raw)
  To: gcc

On Mon, Jun 03, 2002 at 10:51:24PM -0700, Joe Buck wrote:
> >  > Well, I think it mostly depends on whether you see any utility in
> >  > recovering -W to mean what -Wall currently means.  If that's the long
> >  > term goal, -W needs to be deprecated and then removed entirely for a
> >  > release or two, IMO, before it changes functionality.
> 
> > I think changing -W to mean something different is an even worse idea
> > than eliminating it. :-(
> 
> I don't think that eliminating -W is an option at all.  We're stuck with
> it.  We could add -Wextra as a synonym, but that's about it.  It's too
> commonly used and has been in gcc for over a decade.

Okay, a revised proposal:

- recognize both -W and -Wextra
- for --help output and in the manual, only describe -Wextra
- document all the little extra things that -W[extra] currently does

i.e., print no deprecation warnings for -W, leave it in there, but don't
advertise it anymore.  It's too confusing.

I can do the above, no problem.  Right now I do not have the time to split
out -Wextra into 20 separate options, or to split out extra_warnings into
20 separate variables.  However, the updates to the manual should help
anyone who wants to do so.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 23:53   ` Fergus Henderson
  2002-06-04  0:49     ` Joe Buck
@ 2002-06-04  2:15     ` Marc Espie
  1 sibling, 0 replies; 31+ messages in thread
From: Marc Espie @ 2002-06-04  2:15 UTC (permalink / raw)
  To: gcc

In article <20020604164634.B20461@hg.cs.mu.oz.au> you write:
># -Wconversion          really only intended to help people using `unprotoize'

Already, -Wconversion is ill-designed, as it bundles two completely distinct
warnings of vastly different usefulness.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 23:53   ` Fergus Henderson
@ 2002-06-04  0:49     ` Joe Buck
  2002-06-04  2:15     ` Marc Espie
  1 sibling, 0 replies; 31+ messages in thread
From: Joe Buck @ 2002-06-04  0:49 UTC (permalink / raw)
  To: Fergus Henderson; +Cc: mike stump, gcc, wheeler, phil

> # -Waggregate-return    not useful, IMHO

This was from the days when gcc used an arguably-better-but-incompatible
way of returning aggregates on some platforms.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  4:35   ` Phil Edwards
                       ` (2 preceding siblings ...)
  2002-06-03 11:27     ` Marc Espie
@ 2002-06-04  0:09     ` Ross Smith
  3 siblings, 0 replies; 31+ messages in thread
From: Ross Smith @ 2002-06-04  0:09 UTC (permalink / raw)
  To: Phil Edwards, Joseph S. Myers; +Cc: gcc

On Monday, 03 June 2002 23:35, Phil Edwards wrote:
> On Mon, Jun 03, 2002 at 11:52:28AM +0100, Joseph S. Myers wrote:
> >
> > Can you split -W into separate options for the separate things it
> > controls, the way -Wall is just the union of such separate options?
>
> [snip]
>
> That's 20 separate options.  And remember that they are for corner
> cases, so we'd end up with -Wunsigned-compared-against-zero-with-<
> and -Wempty-if-body and
> -Wsubscripting-an-array-declared-as-register...

As a C++ programmer, I would _love_ to be able to turn that first one 
off without losing the rest of -W. I could point to any number of 
places in my code where I tried to make a template that would work for 
both signed and unsigned types, and had to resort to convoluted code to 
avoid that particular warning.

E.g. obvious code that g++ -W -Wall -Werror rejects:

    template <typename T> T absolute(T t) {
      if (t < T(0))
        return -t;
      else
        return t;
    }

Gratuitous complexity to shut gcc up:

    template <typename T> T absolute(T t) {
      if (t > T(0))
        return t;
      else if (t == T(0))
        return t;
      else
        return -t;
    }

-- 
Ross Smith ..................................... Auckland, New Zealand
r-smith@ihug.co.nz ...................................................

  "Never underestimate the power of stupid things in large numbers."
                                                      -- Serious Sam

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 11:29 ` mike stump
  2002-06-03 16:12   ` Russ Allbery
@ 2002-06-03 23:53   ` Fergus Henderson
  2002-06-04  0:49     ` Joe Buck
  2002-06-04  2:15     ` Marc Espie
  2002-10-31  9:34   ` Fergus Henderson
  2 siblings, 2 replies; 31+ messages in thread
From: Fergus Henderson @ 2002-06-03 23:53 UTC (permalink / raw)
  To: mike stump; +Cc: gcc, wheeler, phil

On 03-Jun-2002, mike stump <mrs@windriver.com> wrote:
> > From: "Wheeler, Fred (Research)" <wheeler@crd.ge.com>
> > To: "'gcc@gcc.gnu.org'" <gcc@gcc.gnu.org>
> > Cc: "'phil@jaj.com'" <phil@jaj.com>
> > Date: Mon, 3 Jun 2002 10:07:20 -0400 
> 
> > I think -Wallall should add absolutely every -W* option that exists
> > now or is added in the future.
> 
> I am more interested in a survey of 20 people that have large projects
> that tried to use such an option and whether they thought there was
> any use for it.
> 
> I would be more interested in you trying out such an option, and then
> telling us how wonderful and beneficial it is, and how it helped you.

A long time ago, I wrote a small script that invoked gcc (2.8?)
with all warning options enabled except the following:

# -Wredundant-decls     causes too many complaints in system header files
# -Wconversion          really only intended to help people using `unprotoize'
# -Waggregate-return    not useful, IMHO
# -Wenum-clash          doesn't work with gcc 2.7.x                             

This script has been widely used.  For the Mercury project, I used a
variant of this script, which disabled some additional warnings.

If `-Wallall' existed, I would use it.  I would not use `-Wallall' on its
own; instead I would use it in combination with the appropriate options
to disable warnings which were more trouble than they are worth, e.g.
`-Wallall -Wno-conversion -Wno-aggregate-return'.  But I very much prefer
this model of starting with all warnings enabled and then disabling the
ones that cause trouble.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  7:13       ` Kaveh R. Ghazi
  2002-06-03 16:08         ` Russ Allbery
  2002-06-03 20:02         ` Kaveh R. Ghazi
@ 2002-06-03 23:41         ` Fergus Henderson
  2002-06-21 21:45         ` David O'Brien
  3 siblings, 0 replies; 31+ messages in thread
From: Fergus Henderson @ 2002-06-03 23:41 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: gcc

On 03-Jun-2002, Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote:
> Adding -Wextra as an alias for -W is fine, but IMHO removing -W is
> not.  Why invalidate people's Makefiles and configure scripts that
> have worked for a decade?  For the same reason, we should not issue a
> "deprecated" warning when using -W.

I agree.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 20:02         ` Kaveh R. Ghazi
@ 2002-06-03 22:54           ` Joe Buck
  2002-06-04  8:39             ` Phil Edwards
  0 siblings, 1 reply; 31+ messages in thread
From: Joe Buck @ 2002-06-03 22:54 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: rra, gcc


>  > Well, I think it mostly depends on whether you see any utility in
>  > recovering -W to mean what -Wall currently means.  If that's the long
>  > term goal, -W needs to be deprecated and then removed entirely for a
>  > release or two, IMO, before it changes functionality.

Kaveh writes:
> I think changing -W to mean something different is an even worse idea
> than eliminating it. :-(

I don't think that eliminating -W is an option at all.  We're stuck with
it.  We could add -Wextra as a synonym, but that's about it.  It's too
commonly used and has been in gcc for over a decade.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  7:13       ` Kaveh R. Ghazi
  2002-06-03 16:08         ` Russ Allbery
@ 2002-06-03 20:02         ` Kaveh R. Ghazi
  2002-06-03 22:54           ` Joe Buck
  2002-06-03 23:41         ` Fergus Henderson
  2002-06-21 21:45         ` David O'Brien
  3 siblings, 1 reply; 31+ messages in thread
From: Kaveh R. Ghazi @ 2002-06-03 20:02 UTC (permalink / raw)
  To: rra; +Cc: gcc

 > From: Russ Allbery <rra at stanford dot edu> 
 > 
 > Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:
 > 
 > > Adding -Wextra as an alias for -W is fine, but IMHO removing -W is not.
 > > Why invalidate people's Makefiles and configure scripts that have worked
 > > for a decade?  For the same reason, we should not issue a "deprecated"
 > > warning when using -W.
 > 
 > Well, I think it mostly depends on whether you see any utility in
 > recovering -W to mean what -Wall currently means.  If that's the long
 > term goal, -W needs to be deprecated and then removed entirely for a
 > release or two, IMO, before it changes functionality.

I think changing -W to mean something different is an even worse idea
than eliminating it. :-(

--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Solutions

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 16:12   ` Russ Allbery
@ 2002-06-03 17:09     ` Neil Booth
  0 siblings, 0 replies; 31+ messages in thread
From: Neil Booth @ 2002-06-03 17:09 UTC (permalink / raw)
  To: Russ Allbery; +Cc: gcc

Russ Allbery wrote:-

> It would be completely unusable for INN, at least.  Among the warning
> options that I'll never bother trying to make INN cleanly compile under
> are:
> 
>   -Wtraditional       INN only supports ANSI C; this is irrelevant.
>   -Wid-clash          I really don't care about systems that old.
>   -Wconversion        Really only useful when converting K&R code.
>   -Wmissing-noreturn  The compiler isn't going to guess well enough.

I'm pretty sure I killed -Wid-clash in 3.1.

Neil.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03 11:29 ` mike stump
@ 2002-06-03 16:12   ` Russ Allbery
  2002-06-03 17:09     ` Neil Booth
  2002-06-03 23:53   ` Fergus Henderson
  2002-10-31  9:34   ` Fergus Henderson
  2 siblings, 1 reply; 31+ messages in thread
From: Russ Allbery @ 2002-06-03 16:12 UTC (permalink / raw)
  To: gcc

mike stump <mrs@windriver.com> writes:

>> From: "Wheeler, Fred (Research)" <wheeler@crd.ge.com>
>> To: "'gcc@gcc.gnu.org'" <gcc@gcc.gnu.org>
>> Cc: "'phil@jaj.com'" <phil@jaj.com>
>> Date: Mon, 3 Jun 2002 10:07:20 -0400 

>> I think -Wallall should add absolutely every -W* option that exists
>> now or is added in the future.

> I am more interested in a survey of 20 people that have large projects
> that tried to use such an option and whether they thought there was any
> use for it.

It would be completely unusable for INN, at least.  Among the warning
options that I'll never bother trying to make INN cleanly compile under
are:

  -Wtraditional       INN only supports ANSI C; this is irrelevant.
  -Wid-clash          I really don't care about systems that old.
  -Wconversion        Really only useful when converting K&R code.
  -Wmissing-noreturn  The compiler isn't going to guess well enough.

Note that all of these warning options are useful in specific places.  For
example, when converting K&R code to ANSI C, turning on -Wtraditional and
-Wconversion is useful in finding iffy spots that need manual review.  But
they can't be left on all the time; there are too many false positives
that just result in casts and other such things uglifying the code to no
purpose other than removing warnings.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  7:13       ` Kaveh R. Ghazi
@ 2002-06-03 16:08         ` Russ Allbery
  2002-06-03 20:02         ` Kaveh R. Ghazi
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 31+ messages in thread
From: Russ Allbery @ 2002-06-03 16:08 UTC (permalink / raw)
  To: gcc

Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:

> Adding -Wextra as an alias for -W is fine, but IMHO removing -W is not.
> Why invalidate people's Makefiles and configure scripts that have worked
> for a decade?  For the same reason, we should not issue a "deprecated"
> warning when using -W.

Well, I think it mostly depends on whether you see any utility in
recovering -W to mean what -Wall currently means.  If that's the long term
goal, -W needs to be deprecated and then removed entirely for a release or
two, IMO, before it changes functionality.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  7:07 Wheeler, Fred (Research)
@ 2002-06-03 11:29 ` mike stump
  2002-06-03 16:12   ` Russ Allbery
                     ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: mike stump @ 2002-06-03 11:29 UTC (permalink / raw)
  To: gcc, wheeler; +Cc: phil

> From: "Wheeler, Fred (Research)" <wheeler@crd.ge.com>
> To: "'gcc@gcc.gnu.org'" <gcc@gcc.gnu.org>
> Cc: "'phil@jaj.com'" <phil@jaj.com>
> Date: Mon, 3 Jun 2002 10:07:20 -0400 

> I think -Wallall should add absolutely every -W* option that exists
> now or is added in the future.

I am more interested in a survey of 20 people that have large projects
that tried to use such an option and whether they thought there was
any use for it.

I would be more interested in you trying out such an option, and then
telling us how wonderful and beneficial it is, and how it helped you.

In the end, I can't help but think that we'll make all this noise
about it, even implement it and that at the end of the day, not once
person will use it or find it useful.  A feature without use, isn't a
feature.  An option, without a feature, is pointless.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  4:35   ` Phil Edwards
  2002-06-03  5:18     ` Joseph S. Myers
  2002-06-03  5:23     ` Neil Booth
@ 2002-06-03 11:27     ` Marc Espie
  2002-06-04  0:09     ` Ross Smith
  3 siblings, 0 replies; 31+ messages in thread
From: Marc Espie @ 2002-06-03 11:27 UTC (permalink / raw)
  To: gcc

In article <20020603073501.A9892@disaster.basement.lan> you write:
>On Mon, Jun 03, 2002 at 11:52:28AM +0100, Joseph S. Myers wrote:
>> On Mon, 3 Jun 2002, Phil Edwards wrote:
>> 
>> > (I've been finding all the things that -W controls right now, and will
>> > update the manual.  I'll probably need some help coming up with example
>> > code that triggers the warning.)
>> 
>> Can you split -W into separate options for the separate things it
>> controls, the way -Wall is just the union of such separate options?
>
>Well, I /can/, but I don't think it's a good idea.  Do we really want that
>many new -W* options?

Yes.

Or more specifically, I could use them, and I suspect I'm not alone.

Separate -W options are very, very useful in -Werror contexts, for instance.
It's often the case that sometimes, the compiler, or the system headers,
or whatever circumstances, makes one warning more or less useless.

Having separate switches for all W flags makes it possible to fine-tune a
compile to specific circumstances.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  5:18     ` Joseph S. Myers
  2002-06-03  6:19       ` Phil Edwards
@ 2002-06-03  7:13       ` Kaveh R. Ghazi
  2002-06-03 16:08         ` Russ Allbery
                           ` (3 more replies)
  1 sibling, 4 replies; 31+ messages in thread
From: Kaveh R. Ghazi @ 2002-06-03  7:13 UTC (permalink / raw)
  To: phil; +Cc: gcc, jsm28

 > So, here's a proposal just to generate dicussion:
 > 
 > -  that the new name be '-Wextra'
 > -  for 3.2, recognize both -Wextra and -W.  If -W is used, warn that it
 >    has been renamed and will be removed...
 > -  ...in GCC 3.3 or 3.4, -W goes away.  Whatever version we decide, include
 >    that number in the warning.
 > 
 > Thoughts?


Phil,

Adding -Wextra as an alias for -W is fine, but IMHO removing -W is
not.  Why invalidate people's Makefiles and configure scripts that
have worked for a decade?  For the same reason, we should not issue a
"deprecated" warning when using -W.

Just make -Wextra the *documented* way to get the extra warnings and
you'll solve the problem of explaining to newbies what the flag means.

Those who already use -W in their config already know what it does.

		--Kaveh

--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Solutions

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
@ 2002-06-03  7:07 Wheeler, Fred (Research)
  2002-06-03 11:29 ` mike stump
  0 siblings, 1 reply; 31+ messages in thread
From: Wheeler, Fred (Research) @ 2002-06-03  7:07 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'; +Cc: 'phil@jaj.com'

Greetings,

I posted this suggestion years ago, and am repeating it since it is related to the current warning
option (-Wextra) discussion.  The original post is at
  http://gcc.gnu.org/ml/gcc/1998-11/msg00580.html
The original suggestion is repeated below.  There was some follow-up discussion that is still
available on the archives.

-----------------------------------------------------------

In the interest of less messy command lines I suggest a new option for
gcc: -Wallall.  Right now -Wall adds about a dozen important -W*
options.  I think -Wallall should add absolutely every -W* option that
exists now or is added in the future.  Common usage would be to use
the -Wallall option to add all options and then remove unwanted
warning options with -Wno-*, and specify specific arguments to options
like -Wlarger-than-NNN.

Example:

  gcc -Wallall -Wno-error -Wlarger-than-32 -Wno-aggregate-return ...

Regards,
Fred Wheeler

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  5:18     ` Joseph S. Myers
@ 2002-06-03  6:19       ` Phil Edwards
  2002-06-03  7:13       ` Kaveh R. Ghazi
  1 sibling, 0 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-03  6:19 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc

On Mon, Jun 03, 2002 at 01:18:25PM +0100, Joseph S. Myers wrote:
> Some things can probably go together.  Others can go in existing options, 
> possibly in -Wall - for example, warnings for "a <= b <= c" could 
> reasonably be put in -Wparentheses.
[...]
> As an external option, like -Wall, yes.  As an internal variable, I don't
> like the use of extra_warnings to control many disparate things, even if
> not everything has an external option to control it separately.

I don't disagree, but that's a bigger change than what was requested on
the project page.  One problem at a time, please.

Speaking of problems:  I've made -W print a "this is deprecated" warning,
but 'make check-gcc' doesn't give me any failures.  I don't even see the
"deprecated" text show up in the .log files.  Surely something should be
failing?


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  4:35   ` Phil Edwards
  2002-06-03  5:18     ` Joseph S. Myers
@ 2002-06-03  5:23     ` Neil Booth
  2002-06-03 11:27     ` Marc Espie
  2002-06-04  0:09     ` Ross Smith
  3 siblings, 0 replies; 31+ messages in thread
From: Neil Booth @ 2002-06-03  5:23 UTC (permalink / raw)
  To: Phil Edwards; +Cc: Joseph S. Myers, gcc

Phil Edwards wrote:-

> On Mon, Jun 03, 2002 at 11:52:28AM +0100, Joseph S. Myers wrote:
> > On Mon, 3 Jun 2002, Phil Edwards wrote:
> > 
> > > (I've been finding all the things that -W controls right now, and will
> > > update the manual.  I'll probably need some help coming up with example
> > > code that triggers the warning.)
> > 
> > Can you split -W into separate options for the separate things it
> > controls, the way -Wall is just the union of such separate options?
> 
> Well, I /can/, but I don't think it's a good idea.  Do we really want that
> many new -W* options?

I don't think we do either; we've already got more than enough.

What we really need is a way to turn off warnings at an area of
code, though getting agreement on how to do that appears to be
the issue.

Neil.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  4:35   ` Phil Edwards
@ 2002-06-03  5:18     ` Joseph S. Myers
  2002-06-03  6:19       ` Phil Edwards
  2002-06-03  7:13       ` Kaveh R. Ghazi
  2002-06-03  5:23     ` Neil Booth
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 31+ messages in thread
From: Joseph S. Myers @ 2002-06-03  5:18 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc

On Mon, 3 Jun 2002, Phil Edwards wrote:

> That's 20 separate options.  And remember that they are for corner cases, so
> we'd end up with -Wunsigned-compared-against-zero-with-< and -Wempty-if-body
> and -Wsubscripting-an-array-declared-as-register...

Some things can probably go together.  Others can go in existing options, 
possibly in -Wall - for example, warnings for "a <= b <= c" could 
reasonably be put in -Wparentheses.

> The idea of a single option to warn about "oddball things which are usually
> suspect, but not always" makes sense to me.  It's just the spelling that
> GCC got wrong.

As an external option, like -Wall, yes.  As an internal variable, I don't
like the use of extra_warnings to control many disparate things, even if
not everything has an external option to control it separately.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  3:52 ` Joseph S. Myers
@ 2002-06-03  4:35   ` Phil Edwards
  2002-06-03  5:18     ` Joseph S. Myers
                       ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-03  4:35 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc

On Mon, Jun 03, 2002 at 11:52:28AM +0100, Joseph S. Myers wrote:
> On Mon, 3 Jun 2002, Phil Edwards wrote:
> 
> > (I've been finding all the things that -W controls right now, and will
> > update the manual.  I'll probably need some help coming up with example
> > code that triggers the warning.)
> 
> Can you split -W into separate options for the separate things it
> controls, the way -Wall is just the union of such separate options?

Well, I /can/, but I don't think it's a good idea.  Do we really want that
many new -W* options?

The manual currently lists 10 things warned about by -W.  One of them has
been moved into its own option already, but the manual wasn't updated.
I've found another 5 undocumented uses in the C-family group, and an
additional 6 in C++.  The only occurances of extra_warnings (the variable
in question) in Chill and Objective-C were in deleted files.  None in Java,
and I haven't looked at Ada (and since I can't build it, don't much plan to).

That's 20 separate options.  And remember that they are for corner cases, so
we'd end up with -Wunsigned-compared-against-zero-with-< and -Wempty-if-body
and -Wsubscripting-an-array-declared-as-register...

The idea of a single option to warn about "oddball things which are usually
suspect, but not always" makes sense to me.  It's just the spelling that
GCC got wrong.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  0:48 Phil Edwards
  2002-06-03  2:56 ` Russ Allbery
@ 2002-06-03  3:52 ` Joseph S. Myers
  2002-06-03  4:35   ` Phil Edwards
  1 sibling, 1 reply; 31+ messages in thread
From: Joseph S. Myers @ 2002-06-03  3:52 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc

On Mon, 3 Jun 2002, Phil Edwards wrote:

> (I've been finding all the things that -W controls right now, and will
> update the manual.  I'll probably need some help coming up with example
> code that triggers the warning.)

Can you split -W into separate options for the separate things it
controls, the way -Wall is just the union of such separate options?  (Of
course, each such option should have testcases.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  2:56 ` Russ Allbery
@ 2002-06-03  3:26   ` Phil Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-03  3:26 UTC (permalink / raw)
  To: Russ Allbery; +Cc: gcc

On Mon, Jun 03, 2002 at 02:56:35AM -0700, Russ Allbery wrote:
> It would be kind of cool if GCC could eventually reclaim -W to mean the
> same thing as -Wall does now.  That would make a lot more sense to me at
> least, to use -W to turn on the most commonly used set of warnings.

You've been reading my list of "things to suggest for 3.9" haven't you?


> I agree that the current meaning is just weird, and at least for me the
> fiddling about with makefiles that would be required for this change would
> be worth it for making things less strange for new users.

We'll have to play a minor game in GCC's own makefiles, because we're
passing -W during bootstrapping.  And if we do emit a -W-is-deprecated
warning, we shouldn't do it while building our own program!  Of course
we can't change -W to -Wextra in Makefile.in since nobody's installed GCC
will know about -Wextra yet.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Rename -W to -Wextra ?
  2002-06-03  0:48 Phil Edwards
@ 2002-06-03  2:56 ` Russ Allbery
  2002-06-03  3:26   ` Phil Edwards
  2002-06-03  3:52 ` Joseph S. Myers
  1 sibling, 1 reply; 31+ messages in thread
From: Russ Allbery @ 2002-06-03  2:56 UTC (permalink / raw)
  To: gcc

Phil Edwards <phil@jaj.com> writes:

> So, here's a proposal just to generate dicussion:

> -  that the new name be '-Wextra'
> -  for 3.2, recognize both -Wextra and -W.  If -W is used, warn that it
>    has been renamed and will be removed...
> -  ...in GCC 3.3 or 3.4, -W goes away.  Whatever version we decide, include
>    that number in the warning.

> Thoughts?

It would be kind of cool if GCC could eventually reclaim -W to mean the
same thing as -Wall does now.  That would make a lot more sense to me at
least, to use -W to turn on the most commonly used set of warnings.

I agree that the current meaning is just weird, and at least for me the
fiddling about with makefiles that would be required for this change would
be worth it for making things less strange for new users.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Rename -W to -Wextra ?
@ 2002-06-03  0:48 Phil Edwards
  2002-06-03  2:56 ` Russ Allbery
  2002-06-03  3:52 ` Joseph S. Myers
  0 siblings, 2 replies; 31+ messages in thread
From: Phil Edwards @ 2002-06-03  0:48 UTC (permalink / raw)
  To: gcc

This is mentioned on the "beginning GCC hackers" projects list, and since
a) I fall into that category, and b) I just had to explain the whole
-Wall-isn't-really-ALL-but-W-adds-more thing to a colleague, I thought
I'd knock this off.

(I've been finding all the things that -W controls right now, and will
update the manual.  I'll probably need some help coming up with example
code that triggers the warning.)


So, here's a proposal just to generate dicussion:

-  that the new name be '-Wextra'
-  for 3.2, recognize both -Wextra and -W.  If -W is used, warn that it
   has been renamed and will be removed...
-  ...in GCC 3.3 or 3.4, -W goes away.  Whatever version we decide, include
   that number in the warning.

Thoughts?


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2002-11-01 19:05 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-01  6:40 Rename -W to -Wextra ? Wheeler, Fred (Research)
2002-11-01 11:05 ` Joe Buck
  -- strict thread matches above, loose matches on Subject: below --
2002-06-03  7:07 Wheeler, Fred (Research)
2002-06-03 11:29 ` mike stump
2002-06-03 16:12   ` Russ Allbery
2002-06-03 17:09     ` Neil Booth
2002-06-03 23:53   ` Fergus Henderson
2002-06-04  0:49     ` Joe Buck
2002-06-04  2:15     ` Marc Espie
2002-10-31  9:34   ` Fergus Henderson
2002-06-03  0:48 Phil Edwards
2002-06-03  2:56 ` Russ Allbery
2002-06-03  3:26   ` Phil Edwards
2002-06-03  3:52 ` Joseph S. Myers
2002-06-03  4:35   ` Phil Edwards
2002-06-03  5:18     ` Joseph S. Myers
2002-06-03  6:19       ` Phil Edwards
2002-06-03  7:13       ` Kaveh R. Ghazi
2002-06-03 16:08         ` Russ Allbery
2002-06-03 20:02         ` Kaveh R. Ghazi
2002-06-03 22:54           ` Joe Buck
2002-06-04  8:39             ` Phil Edwards
2002-06-04  9:33               ` Joe Buck
2002-06-04  9:59               ` Joseph S. Myers
     [not found]               ` <Pine.LNX.4.33.0206041733540.26576-100000@kern.srcf.societi es.cam.ac.uk>
2002-06-04 11:41                 ` Andrea 'Fyre Wyzard' Bocci
2002-06-04 12:27                   ` Phil Edwards
2002-06-03 23:41         ` Fergus Henderson
2002-06-21 21:45         ` David O'Brien
2002-06-03  5:23     ` Neil Booth
2002-06-03 11:27     ` Marc Espie
2002-06-04  0:09     ` Ross Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).