+2004-09-21 Steven G. Kargl <kargls@comcast.net>
+
+ * libgfortran.h: define gfc_alloca()
+ * intrinsics/env.c (getenv, get_environment_variable_i4): Use it.
+
2004-09-21 Bud Davis <bdavis9659@comcast.net>
PR fortran/17286
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
-#include <alloca.h>
#include "libgfortran.h"
name_len--;
/* Make a null terminated copy of the string. */
- name_nt = alloca (name_len + 1);
+ name_nt = gfc_alloca (name_len + 1);
memcpy (name_nt, name, name_len);
name_nt[name_len] = '\0';
name_len--;
}
/* Make a null terminated copy of the name. */
- name_nt = alloca (name_len + 1);
+ name_nt = gfc_alloca (name_len + 1);
memcpy (name_nt, name, name_len);
name_nt[name_len] = '\0';
/* Common declarations for all of libgfor.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>, and
Andy Vaught <andy@xena.eas.asu.edu>
#define filename prefix(filename)
extern char *filename;
+/* Avoid conflicting prototypes of alloca() in system headers by using
+ GCC's builtin alloca(). */
+
+#define gfc_alloca(x) __builtin_alloca(x)
+
/* main.c */