This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ Bug or (my) Interpretation error


On Sun, Sep 14, 2008 at 15:23, Arthur Schwarz <aschwarz1309@verizon.net> wrote:
>
> I would have expected that the last result would have been not equal. What seems to be happening is either the original 'num' is being compared to itself or the pre-increment 'num' is being compared to itself. At first blush, this appears wrong. Have I misunderstood the semantics?
>

My understanding is that all this is fundamentally UB, since you're
reading and updating values without a sequence point separating them.
It's the same sort of thing as why i = i++; is UB.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]