🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2604

Re: Legal alloca?

#2604
From: Konrad Schwarz
Date: Wed, 17 Apr 1996 01:44
16 lines
1292 bytes
In article <4kr7b2$kcb@solutions.solon.com>, stanr@tiac.net (Stan Ryckman) writes:

|> alloca() is also similarly situated.  In "simple" cases, you
|> can use it and it seems like a function, but you can't do
|> everything with it that you can do with other functions; it's not
|> a full-fledged function.  I forget what breaks it exactly, but passing
|> a pointer to it certainly makes implementation a mess for some
|> architectures.

It's unwise to call alloca when evaluating actual arguments of a function call,
since this will put the buffer smack in the middle of the argument passing
area on the stack.   (If you're sure that your target compilers don't
pass arguments in registers (very rare), you might be able to use this to pass a
run-time variable number of arguments.)

Konrad Schwarz
Technical Details
Message-ID: <4l1ie3$q0b@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4klidc$ne8@solutions.solon.com> <4koe4u$8sl@solutions.solon.com> <4kr7b2$kcb@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz)
Newsgroups: comp.lang.c.moderated
Subject: Re: Legal alloca?
Date: 16 Apr 1996 20:44:35 -0500
Organization: TU Wien
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4l1ie3$q0b@solutions.solon.com>
References: <4klidc$ne8@solutions.solon.com> <4koe4u$8sl@solutions.solon.com> <4kr7b2$kcb@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com