This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: a warning to implement


> -----Original Message-----
> From: Gabriel Dos Reis [mailto:gdr@codesourcery.com]
> Sent: Friday, February 08, 2002 5:29 PM
> To: dewar@gnat.com
> Cc: Dautrevaux@microprocess.com; gdr@codesourcery.com; 
> gcc@gcc.gnu.org;
> nathan@cs.bris.ac.uk; rsandifo@redhat.com
> Subject: Re: a warning to implement
> 
> 
> dewar@gnat.com (Robert Dewar) writes:
> 
> | >>| I think here we should REALLY had a warning;
> | 
> | Yes, good point from Bernard, I agree this is a case that 
> really needs
> | a warning.
> 
> There was no good point.  The class I showed wasn't designed to have a
> default constructor -- that is part of its specification.  The
> compiler (or Bernard) shouldn't insist on knowing more than the
> class-defisgner. 

OK; fine. But then you are saying that if a gun-holder wants to shoot
himself in the foot, nobody should warn him that this isn't *usually* a good
idea? an dyou insist that if someone is able to warn him, this warning
should *in no case* be emitted by default, but only if he choose to get it?

IMHO a compiler should warn the user of all possible cases where he may be
shooting into his own foot (or into another one's foot FWIW :-)); what I
could agree is that this warning could be disable by people that really want
to point the gun to their foot but knows there are cute enough to shoot just
between they toes, but the compiler should not assumbe blindly they are cute
enough.

After all, if you suddenly get a warning about a construct you're using
because you know what you do, you will then be inclined to RTFM and then
will discover the magic "-Wno-self-initialize" option that get you rid of
this anoying warning. 

But saving *you* the small burden of saying to the compiler "Hi, I'm a very
experienced programmer and I know exactly what I'm doing" seems not very
fair to all the "average" programmers that, incidentally, will *never* read
this thread because they don't even imagine what we are talking about.

> 
> There are already plenty of warnings there saying they know more than
> thge programmer -- and in effect thery don't -- ending with being
> completely unusable in modern C++; an example is -Weffc++ (or whatever
> it is called). 

OK; I 200% agree with you: "-Weffc++" is NOT a warning i would expect to be
activated by "-Wall". It's not a warning about dubious or dangerous
constructs, but a warning to help someone (obviously not you, nor me in
fact) adhere to some coding conventions that nobody request anybody to
accept.
 
	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]