monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Re: using empty() instead of size()


From: Bruce Stephens
Subject: Re: [Monotone-devel] Re: using empty() instead of size()
Date: Tue, 23 Sep 2008 13:25:51 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Ulf Ochsenfahrt <address@hidden> writes:

[...]

> If there is an invalid pointer in the non-empty list, the program
> can crash.

It can crash, but this is presumably in the realm of undefined
behaviour, so arbitrary things are permitted to happen.

> If the compiler optimizes (i.e. removes) the list traversal, the
> program doesn't crash. Thus, the optimization would change the
> runtime behavior of the program.

Probably, but I think that's a permitted change.

I'd guess a bug report along those lines ("your optimizer caused my
program not to crash!") would be unlikely to be given a high priority.

An implementation with an O(1) implementation of size() would
presumably also not crash at that point either.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]