Blame lib/alloca.in.h

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