🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Legal alloca?

#2613
From: Joachim Huober
Date: Thu, 18 Apr 1996 12:30
24 lines
1603 bytes
In article <4l1h2l$pns@solutions.solon.com>, schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz) writes:
|> In article <4koe4u$8sl@solutions.solon.com>,
|> wirzeniu@cc.helsinki.fi (Lars Wirzenius) writes:
|> 
|> |> 		int *temp;
|> |> 
|> |> 		temp = alloca(bar*sizeof(int));
|> |> 		if (temp == NULL)
|> |> 			return -1;
|> 
|> I have never seen a man page indicating that alloca can fail in the same
|> way as malloc.  I expect a SIGSEGV signal to be posted when stack extension
|> is no longer possible.  (I think this is a feature, since there is usually not
|> much you can do except terminate when memory runs out, anyhow.)
|> 
|> Konrad Schwarz
The man pages of Linux and BSD4.3 indicate that alloca can fail returning
a NULL pointer. About SIGSEGV see my other posting.
-- 
---------------------------------------------------------------------
Joachim Huober                                Phone: +49 731 502-6241
UDINE-Project,            URZ, University of Ulm, 89081 Ulm , Germany
E-mail: joachim.huober@rz.uni-ulm.de 
---------------------------------------------------------------------
Technical Details
Message-ID: <4l5ckd$1t4@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4klidc$ne8@solutions.solon.com> <4koe4u$8sl@solutions.solon.com> <4l1h2l$pns@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: huober_j@spica.rz.uni-ulm.de (Joachim Huober)
Newsgroups: comp.lang.c.moderated
Subject: Re: Legal alloca?
Date: 18 Apr 1996 07:30:05 -0500
Organization: Universitaet Ulm
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4l5ckd$1t4@solutions.solon.com>
References: <4klidc$ne8@solutions.solon.com> <4koe4u$8sl@solutions.solon.com> <4l1h2l$pns@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com