🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #496

Re: Could a function change its argument(s)!?

#496
From: Rick Schubert
Date: Fri, 25 Aug 1989 22:30
14 lines
1290 bytes
In article <1190@tukki.jyu.fi> tarvaine@tukki.jyu.fi (Tapani Tarvainen) writes:
>More specifically, would it be legal to implement free() so
>that it checks all such registers and trashes them (substituting
>some harmless value) if they contain a pointer which becomes
>invalid (points into the freed area)?

There is a principle that states that the implementation may do anything if
a conforming program cannot tell the difference (I think this is part of
the "as if" rule).  This would seem to apply here.  Since there doesn't
appear to be any way that a conforming program could use the contents of
such registers (until they are reassigned legitimate values), it doesn't
seem like it would make any difference if they were trashed.

-- Rick Schubert (rns@se-sd.sandiego.NCR.COM)
Technical Details
Message-ID: <2026@se-sd.NCR.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!ncrlnk!ncr-sd!se-sd!rns
References: <319@cubmol.BIO.COLUMBIA.EDU> <1190@tukki.jyu.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!ncrlnk!ncr-sd!se-sd!rns
From: rns@se-sd.NCR.COM (Rick Schubert )
Newsgroups: comp.std.c
Subject: Re: Could a function change its argument(s)!?
Summary: in some cases!
Message-ID: <2026@se-sd.NCR.COM>
Date: 25 Aug 89 22:30:05 GMT
References: <319@cubmol.BIO.COLUMBIA.EDU> <1190@tukki.jyu.fi>
Reply-To: rns@se-sd.UUCP (Rick Schubert (AEP))
Organization: NCR Corporation, SE-San Diego
Lines: 14