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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 14, 2008 at 15:23, Arthur Schwarz <aschwarz1309@xxxxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux