Blame lib/alloca.in.h

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