This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: named warnings & individual warning control
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Stan Shebs <shebs at apple dot com>,Mark Mitchell <mark at codesourcery dot com>, DJ Delorie <dj at redhat dot com>,gcc at gcc dot gnu dot org
- Date: Mon, 28 Jun 2004 09:48:55 -0700
- Subject: Re: named warnings & individual warning control
- References: <40DCCD92.1060206@apple.com> <200406260233.i5Q2XfW16156@tin.geop.uc.edu>
On Fri, Jun 25, 2004 at 10:33:41PM -0400, Andrew Pinski wrote:
> >
> > Joe Buck wrote:
> >
> > >On Fri, Jun 25, 2004 at 04:02:19PM -0700, Stan Shebs wrote:
> > Or,
> >
> > T* ptr_T __attribute__((I_know_what_Im_doing));
> >
> > to suppress the warning selectively, if the user absolutely
> > must make it go away.
>
>
> Or use the documented way of getting disable the warning:
>
> T *ptr_T = ptr_T;
>
> (which can be turned off by -Winit-self).
In this case, we documented a bug and called it a feature; this
"feature" did not enter GCC on purpose, but people discovered it and
relied on it. In C++ it's a particular problem, as the bug/feature
doesn't warn about use of the left-hand-side variable as an argument
to a constructor either, and I've accidentally coded such bugs.