bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alloca function use discouraged


From: Derek Robert Price
Subject: Re: alloca function use discouraged
Date: Thu, 15 Apr 2004 10:49:57 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Conrad T. Pino wrote:

>Hi Derek,
>
>Linux, FreeBSD, NetBSD discourage it's use and Linux
>man page explains reasons better than others.
>
>Linux man page:
>http://www.die.net/doc/linux/man/man3/alloca.3.html
>
>FreeBSD man page:
>http://www.freebsd.org/cgi/man.cgi?query=alloca
>
>NetBSD man page:
>http://netbsd.gw.com/cgi-bin/man-cgi?alloca++NetBSD-current
>
>Given that "alloca" is machine and compiler dependant we
>should give consideration to MS VC "_alloca" function:
>http://msdn.microsoft.com/library/en-us/vccore98/HTML/_crt__alloca.asp
>
>Conrad


Hence the GNULIB version.  The GNULIB project attempts to write
portable replacements for functions that do not work consistently
across machines and compilers.

It does look like the GNULIB alloca_.h is trying to use the MSC
version of _alloca, however:

#  ifdef _MSC_VER
#   include <malloc.h>
#   define alloca _alloca
#  endif

This should mean that the alloca.c module is not required to be
compile on Windows, so I don't know why you had to add it to get
fnmatch to compile, if you want to look into this and fix it.  Perhaps
HAVE_ALLOCA_H needs be defined in windows-NT/config.h.in?

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAfqEULD1OTBfyMaQRAt2nAKDZOI7BnNJ2aEAqxfsYOpa1skmJ7QCg18vN
Ad9a1UVT5mRheo5qXsLC3ug=
=XMA3
-----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]