Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!oliveb!sun!david From: david@sun.uucp (David DiGiacomo) Newsgroups: comp.lang.c Subject: alloca (was Re: Are yacc parsers portable ?) Message-ID: <62363@sun.uucp> Date: 2 Aug 88 00:55:34 GMT References: <3950010@eecs.nwu.edu> <62170@sun.uucp> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 21 In article <62170@sun.uucp> swilson@sun.UUCP (Scott Wilson) writes: >My main complaint with Bison was that both the source for Bison (last I >looked) and the parser it produces rely on alloca - a method for allocating >space on the stack that is automatically reclaimed when the function >that calls it exits. Alloca is found on BSD derived systems and >I am told on other UNIX's. It, however, is less than universally >available (the manual page states: "alloca() is both machine- and >compiler-dependent; its use is discouraged"). I had a rather protected >mail war with several people associated with Bison and/or FSF regarding >this. My opinion was that FSF would be doing computer users a greater >service by writing more portable code when possible. The FSF people aren't evil (?), they just disagree with the author of that man page blurb about the usefulness and implementation difficulty of alloca. By distributing excellent software which makes good use of alloca, they are ensuring that all self-respecting C compiler/library vendors will provide an efficient implementation of it. They even help out the alloca-deprived by providing Doug Gwyn's malloc based alloca. Seems reasonable to me! -- David DiGiacomo, Sun Microsystems, Mt. View, CA sun!david david@sun.com