On 2009-11-03, Old Wolf <> wrote:
> Is this program guaranteed to print 10, or can the compiler
> get 'confused' by the const and assume the variable
> still has its initial value?
I would say it has to print 10. There's no restrict anywhere in sight,
there's questionable aliasing, so I think the compiler's obliged to
assume that modifications of other objects with compatible types could
potentially modify the thing pointed to by B.
-s
--
Copyright 2009, all wrongs reversed. Peter Seebach /
usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!