Bill Baxter wrote:
On Tue, Dec 23, 2008 at 12:10 PM, bearophile <[email protected]> wrote:
Walter Bright:
I didn't know gcc had pure functions. It doesn't have immutable data. If
it does optimize with it, you can try it and see!
It seems to work:
[...]
As you can see now there's just one call to bar.

Bye,
bearophile


Does GCC complain if you do something clearly impure inside bar?

I got:

    error: attributes are not allowed on a function-definition

Oh well. It looks like a 25% implemented feature. It also only worked with g++. gcc wouldn't accept it at all. Without some sort of immutability, also, purity cannot be checked anyway.

Reply via email to