Add a __nowarn__ keyword
Kaveh R. GHAZI
ghazi@caip.rutgers.edu
Fri Aug 10 03:18:00 GMT 2007
On Thu, 9 Aug 2007, Kaveh R. GHAZI wrote:
> On Thu, 9 Aug 2007, [ISO-8859-1] Manuel López-Ibáñez wrote:
>
> > On 08/08/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > On Wed, 8 Aug 2007, Paolo Bonzini wrote:
> > >
> > > So this is encouraging, I added OPT_Wcast_qual to the warning statement
> > > and now it obeys the #pragma (or _Pragma). However I'm still having one
> > > last problem. The pragma interface is still on/off, not push/pop. I.e.:
> >
> > Can you commit that fix as obvious before we forget about it? Thanks.
>
> Yes, I'll do that. (At the moment, someone killed sparc-solaris
> bootstraps. So even though it's obvious, I'll postpone installing until I
> can test it.)
Here's the patch, it passes "make cc1". But as I said can't bootstrap
right now because of this:
http://gcc.gnu.org/ml/gcc/2007-08/msg00149.html
The C++ frontend needs a separate patch, but it's not a one-liner AFAICT.
--Kaveh
2007-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-typeck.c (build_c_cast): Add OPT_Wcast_qual to warnings.
diff -rup orig/egcc-SVN20070808/gcc/c-typeck.c egcc-SVN20070808/gcc/c-typeck.c
--- orig/egcc-SVN20070808/gcc/c-typeck.c 2007-08-08 15:05:41.090014861 -0400
+++ egcc-SVN20070808/gcc/c-typeck.c 2007-08-09 23:04:49.282366645 -0400
@@ -3556,12 +3556,12 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (in_otype) == POINTER_TYPE);
if (added)
- warning (0, "cast adds new qualifiers to function type");
+ warning (OPT_Wcast_qual, "cast adds new qualifiers to function type");
if (discarded)
/* There are qualifiers present in IN_OTYPE that are not
present in IN_TYPE. */
- warning (0, "cast discards qualifiers from pointer target type");
+ warning (OPT_Wcast_qual, "cast discards qualifiers from pointer target type");
}
/* Warn about possible alignment problems. */
More information about the Gcc-patches
mailing list