--- Comment #6 from manu at gcc dot gnu dot org 2007-03-12 12:10 ---
This seems a duplicate of PR 14710.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
--- Comment #7 from simon_baldwin at yahoo dot com 2007-03-12 21:48 ---
PR 14710 isn't really quite the same thing as PR 28774. PR 14170 is concerned
with unnecessary casts; PR 28774 is concerned with unnecessary const or
volatile qualifiers within otherwise valid and perhaps necessary
--- Comment #5 from manu at gcc dot gnu dot org 2007-01-23 14:35 ---
We already have a warning about discarding qualifiers somewhere. Perhaps we
could just add this to that one (saving us from yet another warning option).
--
manu at gcc dot gnu dot org changed:
What
--- Comment #4 from ian at airs dot com 2006-08-27 06:44 ---
I disagree. It is always useful to optionally warn about meaningless code. It
can be a way to find a real bug in the program. It is not conceptually
different from existing warnings like -Wredundant-decls. The code works
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-08-27 05:03 ---
(In reply to comment #2)
icc warns here; this PR aims to improve agreement in warnings between g++ and
icc.
HUH? Why do you want that? GCC warns in more places than ICC will ever warn.
To me this is an
--- Comment #2 from simon_baldwin at yahoo dot com 2006-08-24 16:53 ---
You didn't miss anything. There's no bug here, just a request for a new
warning message.
As you note, the const-volatile qualifications in the cast have no meaning, and
are completely ignored by the compiler.
--- Comment #1 from bangerth at dealii dot org 2006-08-24 01:59 ---
Um, why? The value 1.234 is an rvalue of type double. You cast it to
an rvalue of type const int, which can clearly be assigned to an
int right away without another cast. In fact, const-volatile qualifications
do not