This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] warning: initialization discards qualifiers from pointertarget type
- From: James E Wilson <wilson at specifixinc dot com>
- To: Devang Patel <dpatel at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Apr 2005 18:29:27 -0700
- Subject: Re: [RFC] warning: initialization discards qualifiers from pointertarget type
- References: <6A77930C-1CEB-4A53-AB45-A1AC62621D48@apple.com>
Devang Patel wrote:
warning: initialization discards qualifiers from pointer target type
This warning can not be disabled using -Wno-cast-qual
(or any other warning flags). Is it intentional ?
It looks like we have been doing it this way since at least gcc-1.42.
The same code is there, with no way to disable it, though the wording of
the message is a little different. I didn't try looking back any
farther than that. This seems rather unlikely to be an accident.
Though of course, this doesn't mean that we can't have an option to
control it. -Wno-cast-qual doesn't seem like the right choice, as there
is no user cast here. Maybe something like -Wno-discard-qual, where
-Wdiscard-qual is the default.
I notice that these are pedwarns, not a warning as in the -Wcast-qual
case, which means that the ISO C standard requires a diagnostic here.
For this reason, it may not be wise to add an option to disable the
warnings. You may lose portability to other compilers.
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com