Path: utzoo!utgpu!water!watmath!clyde!att!chinet!bigtex!james From: james@bigtex.uucp (James Van Artsdalen) Newsgroups: comp.sources.d Subject: Re: Simulation of 'alloca' -- can it be done in TurboC or MSC? Message-ID: <2244@bigtex.uucp> Date: 29 May 88 23:51:09 GMT References: <203@lcuxa.UUCP> <3100002@hpsrli.HP.COM> Reply-To: james@bigtex.UUCP (James Van Artsdalen) Organization: F.B.N. Software, Austin TX Lines: 16 IN article <3100002@hpsrli.HP.COM>, darrylo@hpsrli.HP.COM (Darryl Okahata) wrote: > [ code fragment deleted ] > The problem in the above code fragment is that the stack frame allocated at > the start of the if statement block is deallocated at the end of the block. As near as I can tell, that is indeed the nature of alloca(), and hence the code in question is not in error. Perhaps some Joe Vaxhacker out there can say what the BSD code really does. The Microsoft C code does what the 8080 code shown in the original posting did, and my alloca() has gotten away with it too thus far. The BSD 4.3 manuals are, shall we say, somewhat less than definitive on the matter. -- James R. Van Artsdalen ...!ut-sally!utastro!bigtex!james "Live Free or Die" Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746