This is the mail archive of the
mailing list for the GCC project.
Re: a warning to implement
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Bernard Dautrevaux <Dautrevaux at microprocess dot com>
- Cc: "'Gabriel Dos Reis'" <gdr at codesourcery dot com>, dewar at gnat dot com, gcc at gcc dot gnu dot org, nathan at cs dot bris dot ac dot uk, rsandifo at redhat dot com
- Date: 08 Feb 2002 20:48:20 +0100
- Subject: Re: a warning to implement
- Organization: CodeSourcery, LLC
- References: <17B78BDF120BD411B70100500422FC6309E473@IIS000>
Bernard Dautrevaux <Dautrevaux@microprocess.com> writes:
| > -----Original Message-----
| > From: Gabriel Dos Reis [mailto:firstname.lastname@example.org]
| > Sent: Friday, February 08, 2002 5:29 PM
| > To: email@example.com
| > Cc: Dautrevaux@microprocess.com; firstname.lastname@example.org;
| > email@example.com;
| > firstname.lastname@example.org; email@example.com
| > Subject: Re: a warning to implement
| > firstname.lastname@example.org (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
Proof by analogy is fraud.
| 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?
What I'm saying is that if you want to be warned about that construct
then you should explicitly turn on the appropriate flag. In this
case, I do think -Walll should -not- turn that flag on.
| > 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
The example I gave is by no means dubious and dangerous. It is just a
perfectly well-formed implementation of singly-linked circular list.
| but a warning to help someone (obviously not you, nor me in
| fact) adhere to some coding conventions that nobody request anybody to
In case you missed it, I'll repeat again: I'm not arguing against
having an option that implement the warning.