bug-gnulib
[Top][All Lists]
Advanced

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

Re: alloca_.h suggested change


From: Paul Eggert
Subject: Re: alloca_.h suggested change
Date: Mon, 19 Jun 2006 02:41:33 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Thanks for reporting that.  Wouldn't it be safer to skip all forms
of defining alloca, if it's already defined?  I installed this,
which puts an "#ifndef alloca" around everything.

2006-06-19  Paul Eggert  <address@hidden>

        * alloca_.h (alloca) [defined alloca]: Don't define or declare.


--- alloca_.h   14 May 2005 06:03:57 -0000      1.8
+++ alloca_.h   19 Jun 2006 09:39:50 -0000      1.9
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004 Free Software
+   Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -34,19 +34,21 @@
        request, the program just crashes.
  */
 
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# include <stddef.h>
-# ifdef  __cplusplus
+#ifndef alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  include <stddef.h>
+#  ifdef  __cplusplus
 extern "C"
-# endif
+#  endif
 void *alloca (size_t);
+# endif
 #endif
 
 #endif /* _GNULIB_ALLOCA_H */




reply via email to

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