On Wed, Sep 27, 2006 at 04:29:19PM +0200, Georg Baum wrote:
> The only way I can imagine that this works with inset_ == 0 is if the
> compiler optimizes the address taking operator and the dereferencing
> operator away and does this instead:

The compiler does that. In fact, & and * are pretty often translated to
no-ops.

>         return p.inset_ == q.inset_
> ...
> 
> Is this allowed by the standard?

No, this is undefined behaviour.

> Even if it is, should we not better be
> explicit and apply the attached patch?

Yes.

Andre'

Reply via email to