[Bug c++/25845] want optional warning for non-constant declarations that could be constant

pcarlini at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Jan 18 16:19:00 GMT 2006



------- Comment #4 from pcarlini at suse dot de  2006-01-18 16:19 -------
(In reply to comment #3)
> const does nothing when it comes to local variables except for not letting you
> touch it in other expressions.  It does nothing for optimizations or anything
> else.

This last point is not obvious at all, in my opinion. Why not? In principle,
certainly const-ness *can* help optimizers one way or the other. Is this just a
current limitation? A design choice? Anything in the standard making that
tricky? I would like to know more.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25845



More information about the Gcc-bugs mailing list