* [PATCH] use: #pragma GCC diagnostic warning "-Wcast-qual"
@ 2007-08-11 16:47 Kaveh R. GHAZI
2007-08-25 23:58 ` [PING] " Kaveh R. GHAZI
2007-08-29 15:56 ` [PATCH] " Ian Lance Taylor
0 siblings, 2 replies; 3+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-11 16:47 UTC (permalink / raw)
To: gcc-patches; +Cc: dj, gdr
The diagnostic infrastructure by DJ has the nice property that you can
apply or remove -Werror on a per-warning basis. I'd like to apply a patch
to activate -Wcast-qual to GCC but not have it be a hard-error at this
point. There are less than about 20 warnings left (in a solaris2
bootstrap) which are non-trivial to fix. While I'm working on those,
having the -Wcast-qual on helps in two ways.
First it helps avoid warning regressions for people writing new patches.
Second, if there are any -Wcast-qual warnings in machine-dependent parts
that I don't see in my solaris2 bootstrap, perhaps someone will be
motivated to lend me a hand and fix them before -Wcast-qual becomes a
hard-error like the rest of the warnings. Once we're ready to do that,
I'll remove this patch and put -Wcast-qual in the Makefile like the
others.
Bootstrapped on sparc-sun-solaris2.10. I verified that in stage2/3 we see
the -Wcast-qual warnings, but they don't run afoul of -Werror.
Okay for mainline?
Thanks,
--Kaveh
PS: for the record, here is the list of remaining (non-ada) warnings
produced via the #pragma in system.h:
gengtype.c:436: warning: cast discards qualifiers from pointer target type
gengtype.c:1274: warning: cast discards qualifiers from pointer target type
gengtype.c:1276: warning: cast discards qualifiers from pointer target type
gengtype.c:1325: warning: cast discards qualifiers from pointer target type
ggc-common.c:128: warning: cast discards qualifiers from pointer target type
builtins.c:3374: warning: cast discards qualifiers from pointer target type
builtins.c:3378: warning: cast discards qualifiers from pointer target type
builtins.c:3487: warning: cast discards qualifiers from pointer target type
builtins.c:3493: warning: cast discards qualifiers from pointer target type
builtins.c:3835: warning: cast discards qualifiers from pointer target type
builtins.c:3841: warning: cast discards qualifiers from pointer target type
cfgloop.c:800: warning: cast discards qualifiers from pointer target type
cselib.c:237: warning: cast discards qualifiers from pointer target type
stringpool.c:200: warning: cast discards qualifiers from pointer target type
stringpool.c:200: warning: cast discards qualifiers from pointer target type
fortran/module.c:2798: warning: cast discards qualifiers from pointer target type
fortran/module.c:2833: warning: cast discards qualifiers from pointer target type
2007-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* system.h: Activate -Wcast-qual as warning-only.
diff -rup orig/egcc-SVN20070811/gcc/system.h egcc-SVN20070811/gcc/system.h
--- orig/egcc-SVN20070811/gcc/system.h 2007-08-10 14:11:38.000000000 -0400
+++ egcc-SVN20070811/gcc/system.h 2007-08-11 10:09:04.760388233 -0400
@@ -780,4 +780,9 @@ extern void fancy_abort (const char *, i
#define CONST_CAST(X) ((void*)(X))
#endif
+/* Acivate -Wcast-qual as a warning (not an error/-Werror). */
+#if GCC_VERSION >= 4003
+#pragma GCC diagnostic warning "-Wcast-qual"
+#endif
+
#endif /* ! GCC_SYSTEM_H */
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PING] use: #pragma GCC diagnostic warning "-Wcast-qual"
2007-08-11 16:47 [PATCH] use: #pragma GCC diagnostic warning "-Wcast-qual" Kaveh R. GHAZI
@ 2007-08-25 23:58 ` Kaveh R. GHAZI
2007-08-29 15:56 ` [PATCH] " Ian Lance Taylor
1 sibling, 0 replies; 3+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-25 23:58 UTC (permalink / raw)
To: gcc-patches; +Cc: dj, gdr
> 2007-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
>
> * system.h: Activate -Wcast-qual as warning-only.
Ping: I've had to fix several -Wcast-qual regressions in the last few
weeks, I'd like to turn this on so people see them and hopefully avoid
introducing more.
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00741.html
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] use: #pragma GCC diagnostic warning "-Wcast-qual"
2007-08-11 16:47 [PATCH] use: #pragma GCC diagnostic warning "-Wcast-qual" Kaveh R. GHAZI
2007-08-25 23:58 ` [PING] " Kaveh R. GHAZI
@ 2007-08-29 15:56 ` Ian Lance Taylor
1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2007-08-29 15:56 UTC (permalink / raw)
To: Kaveh R. GHAZI; +Cc: gcc-patches, dj, gdr
"Kaveh R. GHAZI" <ghazi@caip.rutgers.edu> writes:
> 2007-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
>
> * system.h: Activate -Wcast-qual as warning-only.
This is OK.
Thanks.
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-29 15:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-11 16:47 [PATCH] use: #pragma GCC diagnostic warning "-Wcast-qual" Kaveh R. GHAZI
2007-08-25 23:58 ` [PING] " Kaveh R. GHAZI
2007-08-29 15:56 ` [PATCH] " Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).