Blame lib/alloca.in.h

Packit 709fb3
/* Memory allocation on the stack.
Packit 709fb3
Packit 709fb3
   Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation,
Packit 709fb3
   Inc.
Packit 709fb3
Packit 709fb3
   This program is free software; you can redistribute it and/or modify it
Packit 709fb3
   under the terms of the GNU General Public License as published
Packit 709fb3
   by the Free Software Foundation; either version 3, or (at your option)
Packit 709fb3
   any later version.
Packit 709fb3
Packit 709fb3
   This program is distributed in the hope that it will be useful,
Packit 709fb3
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 709fb3
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 709fb3
   General Public License for more details.
Packit 709fb3
Packit 709fb3
   You should have received a copy of the GNU General Public
Packit 709fb3
   License along with this program; if not, see
Packit 709fb3
   <http://www.gnu.org/licenses/>.
Packit 709fb3
  */
Packit 709fb3
Packit 709fb3
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
Packit 709fb3
   means there is a real alloca function.  */
Packit 709fb3
#ifndef _GL_ALLOCA_H
Packit 709fb3
#define _GL_ALLOCA_H
Packit 709fb3
Packit 709fb3
/* alloca (N) returns a pointer to N bytes of memory
Packit 709fb3
   allocated on the stack, which will last until the function returns.
Packit 709fb3
   Use of alloca should be avoided:
Packit 709fb3
     - inside arguments of function calls - undefined behaviour,
Packit 709fb3
     - in inline functions - the allocation may actually last until the
Packit 709fb3
       calling function returns,
Packit 709fb3
     - for huge N (say, N >= 65536) - you never know how large (or small)
Packit 709fb3
       the stack is, and when the stack cannot fulfill the memory allocation
Packit 709fb3
       request, the program just crashes.
Packit 709fb3
 */
Packit 709fb3
Packit 709fb3
#ifndef alloca
Packit 709fb3
# ifdef __GNUC__
Packit 709fb3
#  define alloca __builtin_alloca
Packit 709fb3
# elif defined _AIX
Packit 709fb3
#  define alloca __alloca
Packit 709fb3
# elif defined _MSC_VER
Packit 709fb3
#  include <malloc.h>
Packit 709fb3
#  define alloca _alloca
Packit 709fb3
# elif defined __DECC && defined __VMS
Packit 709fb3
#  define alloca __ALLOCA
Packit 709fb3
# elif defined __TANDEM && defined _TNS_E_TARGET
Packit 709fb3
#  ifdef  __cplusplus
Packit 709fb3
extern "C"
Packit 709fb3
#  endif
Packit 709fb3
void *_alloca (unsigned short);
Packit 709fb3
#  pragma intrinsic (_alloca)
Packit 709fb3
#  define alloca _alloca
Packit 709fb3
# elif defined __MVS__
Packit 709fb3
#  include <stdlib.h>
Packit 709fb3
# else
Packit 709fb3
#  include <stddef.h>
Packit 709fb3
#  ifdef  __cplusplus
Packit 709fb3
extern "C"
Packit 709fb3
#  endif
Packit 709fb3
void *alloca (size_t);
Packit 709fb3
# endif
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
#endif /* _GL_ALLOCA_H */