[comp.unix.aix] getting cc to recognize alloca

englund@tramp.colorado.edu (ENGLUND TODD CHARLES) (02/24/91)

     Sorry if this is a FAQ, but does anyone know which flags to
give cc so that it will recognize calls to alloca.  The man page 
for cc/xlc/c89 mentions that a flag is needed to do this, but I 
have not been able to find it in any of the documentation for cc
or alloca. 

Thanks in advance,
Todd

woan@nowhere (Ronald S Woan) (02/24/91)

In article <1991Feb23.195712.21940@csn.org> englund@tramp.colorado.edu (ENGLUND TODD CHARLES) writes:
>     Sorry if this is a FAQ, but does anyone know which flags to
>give cc so that it will recognize calls to alloca.  The man page 
>for cc/xlc/c89 mentions that a flag is needed to do this, but I 
>have not been able to find it in any of the documentation for cc
>or alloca. 

#pragma alloca

at the beginning of each source file that requires alloca should do
the trick.

It's in info under pragma I believe...



--
+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan       woan@peyote.cactus.org or woan%austin@iinus1.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) (02/24/91)

In article <1991Feb23.195712.21940@csn.org> englund@tramp.colorado.edu (ENGLUND TODD CHARLES) writes:
>     Sorry if this is a FAQ, but does anyone know which flags to
>give cc so that it will recognize calls to alloca.  [...]

Put '#pragma alloca' in your source file.

Marc

--
Marc Andreessen___________University of Illinois Materials Research Laboratory
Internet: andreessen@uimrl7.mrl.uiuc.edu____________Bitnet: andreessen@uiucmrl

rcd@ico.isc.com (Dick Dunn) (02/24/91)

andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) writes:
> englund@tramp.colorado.edu (ENGLUND TODD CHARLES) writes:
> >     Sorry if this is a FAQ, but does anyone know which flags to
> >give cc so that it will recognize calls to alloca.  [...]

> Put '#pragma alloca' in your source file.

But is there an answer for the original question?  Sure, it's only a
one-line (per file) change, but one might like to avoid gratuitous changes
to source files, particularly if there are a lot of them (and if, as seems
likely, missing one will make the resulting program fail).  Is there no
compiler flag?
-- 
Dick Dunn     rcd@ico.isc.com -or- ico!rcd       Boulder, CO   (303)449-2870
   ...But is it art?

jsalter@ibmpa.awdpa.ibm.com (02/25/91)

In article<1991Feb24.065504.2044@ico.isc.com> rcd@ico.isc.com (Dick Dunn) writes:
>andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) writes:
>> englund@tramp.colorado.edu (ENGLUND TODD CHARLES) writes:
>> >     Sorry if this is a FAQ, but does anyone know which flags to
>> >give cc so that it will recognize calls to alloca.  [...]
>> Put '#pragma alloca' in your source file.
>But is there an answer for the original question?  Sure, it's only a
>one-line (per file) change, but one might like to avoid gratuitous changes
>to source files, particularly if there are a lot of them (and if, as seems
>likely, missing one will make the resulting program fail).  Is there no
>compiler flag?

There is no compiler flag as of this time.  This is documented in the
/usr/lpp/bos/bsdport document, I believe.

>Dick Dunn     rcd@ico.isc.com -or- ico!rcd       Boulder, CO   (303)449-2870

jim/jsalter  IBM PSP, Palo Alto  T465/(415)855-4427  VNET: JSALTER at AUSVMQ
Internet: jsalter@slo.awdpa.ibm.com         UUCP: ..!uunet!ibmsupt!jsalter 
  PS/2 it, or DIE!  :-)  The ramblings above have nothing to do with Big Blue.

kwh@stiatl.salestech.com (Kurt Hoyt) (02/26/91)

In article <1991Feb23.221233.27936@ux1.cso.uiuc.edu> andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) writes:
>
>Put '#pragma alloca' in your source file.

Has anyone had any success with this and C++? Our translator (Glockenspiel)
likes to prepend code to my C++ source such that the pragma ends up on line
11 rather than line 1, which is where the AIX cc wants it.

-- 
Kurt in Atlanta		|
kwh@stiatl.salestech.com| This space for rent
...!emory!stiatl!kwh	|

andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) (03/10/91)

In article <1192@gagme.chi.il.us> grahj@gagme.chi.il.us (jim graham) writes:
>ok, now I have a question --- of the 2 C bo{oks I have{, I can find no
>explanation {of the #pragma preprocessor directive.....so, what is it?

It's an implementation-defined preprocessor directive; what it's used
for will vary from compiler to compiler.

Marc

--
Marc Andreessen___________University of Illinois Materials Research Laboratory
Internet: andreessen@uimrl7.mrl.uiuc.edu____________Bitnet: andreessen@uiucmrl