nits (gethostbyaddr(), alloca())

Guy Harris guy at auspex.auspex.com
Sat Aug 25 03:51:37 AEST 1990


>	One more time....  alloca is defined by placing a 
>
>#pragma alloca 
>
>in the source file.  This is per ANSI C, I believe.

If you mean that ANSI C specifies that's the way you get at "alloca()",
you believe incorrectly; ANSI C 1) doesn't say what #pragmas exist, much
less what they do, and 2) doesn't specify "alloca()".

Other vendors have used other techniques to teach the compiler about
"alloca()", such as the Sun technique of giving it a funny name
"__builtin_alloca"; this also does not violate the ANSI C standard
(although Sun's compiler isn't yet an ANSI C compiler).  Sun put a
"#define of "alloca(x)" as "__builtin_alloca(x)" in
"/usr/include/alloca.h"; it might be nice if other vendors put their
particular compiler's hacks in a similar include file.



More information about the Comp.unix.aix mailing list