[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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 casts. That said, this PR really isn't all that useful, is tiny, and hasn't received a lot of support, so I'm going to withdraw it (by setting resolution to WONTFIX, which I hope will do the right thing). -- simon_baldwin at yahoo dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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|Removed |Added CC||manu at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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 fine, but something is odd. The behaviour of icc is irrelevant here. If you want to close this again, please give a reason why we should not warn about meaningless code. -- ian at airs dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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 useless warning and in fact goes against what is questionable even to a standards guy. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|WAITING |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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. While it's busy ignoring them, it could note this as a warning, in case the code author really meant something different. icc warns here; this PR aims to improve agreement in warnings between g++ and icc. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774
[Bug c++/28774] Request for warning where const/volatile is ignored in a cast
--- 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 have meaning for rvalues at all, which makes the whole question kinda moot. Or do I miss something? W. -- bangerth at dealii dot org changed: What|Removed |Added CC||bangerth at dealii dot org Status|UNCONFIRMED |WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28774