--- Comment #13 from manu at gcc dot gnu dot org 2009-04-21 19:49 ---
Subject: Bug 35711
Author: manu
Date: Tue Apr 21 19:49:23 2009
New Revision: 146537
URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=146537
Log:
2009-04-21 Manuel Lopez-Ibanez m...@gcc.gnu.org
PR
--- Comment #14 from manu at gcc dot gnu dot org 2009-04-21 19:53 ---
I am going to mark this as FIXED for GCC 4.5.
A possible enhancement could be to mention which qualifiers are casted away.
However, this is not trivial and the warning already mentions the types, so
perhaps it is
--- Comment #12 from manu at gcc dot gnu dot org 2009-02-08 15:51 ---
Patch: http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00806.html
--
manu at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #8 from schwab at suse dot de 2009-01-07 09:39 ---
Casting (void **) to (const void **) is unsafe so it is not ok to drop the
warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35711
--- Comment #9 from ian at airs dot com 2009-01-07 14:27 ---
How is it unsafe? All the const qualifier on a pointer means is that the
memory will not be changed through that pointer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35711
--- Comment #10 from joseph at codesourcery dot com 2009-01-07 15:34
---
Subject: Re: bad text in -Wcast-qual warning (forgets volatile)
On Wed, 7 Jan 2009, ian at airs dot com wrote:
How is it unsafe? All the const qualifier on a pointer means is that the
memory will not be
--- Comment #11 from ian at airs dot com 2009-01-07 15:41 ---
Oh yeah, sorry for the noise.
In any case, the warning message is wrong, as the cast does not cast away
constness.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35711
--- Comment #7 from ian at airs dot com 2009-01-07 02:41 ---
Probably related to this, we get a bad warning for
extern void** foo();
const void** bar() { return (const void **) foo(); }
foo.cc:2: warning: cast from type void** to type const void** casts away
constness
I don't see
--- Comment #2 from manu at gcc dot gnu dot org 2008-08-29 01:56 ---
The obvious fix is to say qualifiers instead of constness. At the point of
warning we only know that the conversion is invalid but not why. It is almost
magic that we only warn for qualifiers.
--
--- Comment #3 from pinskia at gcc dot gnu dot org 2008-08-29 03:08 ---
(In reply to comment #2)
It is almost magic that we only warn for qualifiers.
You can get the same message with an error message too:
int* foo (volatile int *p)
{
return static_castint*p;
}
As static_cast
--- Comment #4 from manu at gcc dot gnu dot org 2008-08-29 03:31 ---
(In reply to comment #3)
(In reply to comment #2)
It is almost magic that we only warn for qualifiers.
You can get the same message with an error message too:
Sorry, I meant that it is almost magic that we only
--- Comment #5 from pinskia at gcc dot gnu dot org 2008-08-29 03:33 ---
(In reply to comment #4)
Why such changes are not contributed back to FSF's GCC? I thought you would
know better... :-(
It only happened in the last two months, it is on my list of things to
contribute back in
--- Comment #6 from manu at gcc dot gnu dot org 2008-08-29 03:37 ---
OK. Anyway, I am testing a patch for this already.
--
manu at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #1 from manu at gcc dot gnu dot org 2008-03-27 14:14 ---
Confirmed in trunk and GCC 4.3.0
--
manu at gcc dot gnu dot org changed:
What|Removed |Added
14 matches
Mail list logo