This is the mail archive of the gcc-patches@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: Patch for various warnings in gcc


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


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