Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Takeyasu Wakabayashi <twakaba@eco.toyama-u.ac.jp>
Subject: Re: ccc linking errors
Date: 2000/05/29	[thread overview]
Message-ID: <m2u2fh6bb6.fsf@eco.toyama-u.ac.jp> (raw)
In-Reply-To: 8gp7lq$kmi$1@pulp.srv.ualberta.ca

michal@gortel.phys.ualberta.ca (Michal Jaegermann) writes:

> : gtkdtree.o: In function `gtk_dtree_do_select_dir':
> : :316: undefined reference to `alloca'
>                                 ^^^^
> In gcc 'alloca()' is usually a "builtin"; therefore it is ccc
> responsibility to provide a replacement one way or another (as a builtin
> or by providing a command to link with an appriopriate library).  Is
> this the current version of ccc and binary utilities?  If this fails
> then you should have big problems all over the place.  In the worst
> case find which library supplies a replacement alloca and add it to
> a link list yourself.


I think

#include <alloca.h>
#pragama intrinsic (alloca)

will work. Try the following program:

#include <alloca.h>
#pragma intrinsic (alloca)
#include <stdio.h>

int main(void)
{
	int *var;

	var = alloca(sizeof(int));
	*var = 1;
	printf("value of *var: %d\n", *var);
	return 0;
}

--
    Takeyasu Wakabayashi
    Faculty of Economics, Toyama University
    twakaba@eco.toyama-u.ac.jp



      parent reply	other threads:[~2000-05-29  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-27  4:00 ccc linking errors h0l0gRaM
2000-05-27  4:00 ` Tony Hammitt
2000-05-27  4:00 ` Michal Jaegermann
2000-05-28  4:00   ` Tony Hammitt
2000-05-29  4:00   ` Takeyasu Wakabayashi [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox