[comp.unix.sysv386] alloca - is it bad?

pss610@unhd.unh.edu (Paul S Secinaro) (03/23/91)

I've recently been compiling a lot of GNU software on my system, and I've
noticed that a lot of the README's talk about how some systems have bad
'alloca' library functions.

My question is: is there any way to find out if my alloca is bad?  I've
compiled GCC and a few other things with the standard alloca (in libPW.a,
apparently) and they seem to work okay so far, but you can never tell when
a bug will pop up (usually, at the worst time).  Will the replacement function
supplied with EMACS work, and should I use it just to be safe?

I'm using AT&T SVR3.2.1 and the C Software Development Set 4.1.6.

Thanks,

Paul Secinaro

-- 


Paul S. Secinaro
University of New Hampsire

art@pilikia.pegasus.com (Art Neilson) (03/24/91)

In article <1991Mar22.171241.29401@unhd.unh.edu> pss610@unhd.unh.edu (Paul S Secinaro) writes:
>
>I've recently been compiling a lot of GNU software on my system, and I've
>noticed that a lot of the README's talk about how some systems have bad
>'alloca' library functions.
>
>My question is: is there any way to find out if my alloca is bad?  I've
>compiled GCC and a few other things with the standard alloca (in libPW.a,
>apparently) and they seem to work okay so far, but you can never tell when
>a bug will pop up (usually, at the worst time).  Will the replacement function
>supplied with EMACS work, and should I use it just to be safe?
>
>I'm using AT&T SVR3.2.1 and the C Software Development Set 4.1.6.

The alloca function in the Sys5r3 libPW.a library works OK as long as
optimization is not enabled when compiling programs which reference
alloca.  Specifically, inlining alloca will break it, if you must have
optimization make sure you disable function inlining via the cc compiler
option -W2,'-y 0'. 
-- 
Arthur W. Neilson III		| INET: art@pilikia.pegasus.com
Bank of Hawaii Tech Support	| UUCP: uunet!ucsd!nosc!pilikia!art