effect of free()

Ian Dall idall at augean.OZ
Wed Sep 20 17:12:04 AEST 1989


In article <10983 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <21952 at cup.portal.com> Tim_CDC_Roberts at cup.portal.com writes:
>>Isn't this a quality of implementation issue?  ...  Thus, in the case above,
>>I would insist that the compiler writer move the address to a general-purpose
>>register and do the comparison there.
>
>It runs contrary to the "spirit of C" to require the implementation to
>generate code that does operations the hard way when a more natural way
>would suffice.

It violates the law of least surprises to have variables suddenly made
inaccessable by being a call by value argument to a function.

C used to be a language where I felt comfortable because I had a pretty
good idea of its basic principles. The concept of variables becoming
invalidated by function calls seems to my very counter-intuitive and
unless there is a STRONG efficiency argument on a reasonably desirable
architecture, then I think compilers should be required to do the comparison
in such a way that they don't generate traps.

.
.
.

-- 
 Ian Dall           life (n). A sexually transmitted disease which afflicts
                              some people more severely than others.
idall at augean.oz



More information about the Comp.lang.c mailing list