This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for various warnings in gcc
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, ghazi at caip dot rutgers dot edu (Kaveh R. Ghazi), dave dot anglin at nrc dot ca, matz at suse dot de, gcc-patches at gcc dot gnu dot org
- Date: 08 Aug 2002 19:23:12 +0200
- Subject: Re: Patch for various warnings in gcc
- Organization: CodeSourcery, LLC
- References: <FFB4A743-AAF0-11D6-846A-003065C86F94@apple.com>
Dale Johannesen <dalej@apple.com> writes:
| type1 a;
| {
| type2 a = (type2)a;
|
| under the impression that the last a referred to the outer-block a. (Not
| everybody is a language lawyer.) A warning would have helped him. It
| seems to me this kind of mistake is more common than any legitimate use
| for the construct; indeed, I can't think of a use that does something
| useful.
For C, you might certainly be right.
But for C++, I'd hate to get a noise^Wwarning for
struct circular_link {
circular_link* previous;
circular_link(circular_link& link) : previous(&link) { }
};
circular_link link = link;
-- Gaby