[parisc-linux] Re: Looking at vfprintf.c and alloca.

John David Anglin dave at hiauly1.hia.nrc.ca
Wed Jul 19 22:54:40 MDT 2006


> Which brings me to the subject of this thread, the vfprintf.c
> is a "good, old fashioned, programming error" if the code expects
> the stack space generated by alloca to be contiguous with any
> other stack object.  That is true for either series compiler,
> on any machine, regardless of stack direction growth.
> (The man page for alloca could also use some help.  Its text
> ignores the effect of compiler stack padding.)

I agree that the linux man page doesn't accurately describe the
behavior of alloca on hppa when it is inlined by gcc:

	The  alloca() function allocates size bytes of space in
	the stack frame of the caller.

The HP man page is more accurate:

	Allocates space from the stack of the caller for
	a block of at least size bytes, ...

Dave
-- 
J. David Anglin                                  dave.anglin at nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)



More information about the parisc-linux mailing list