This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran
- From: Marek Polacek <polacek at redhat dot com>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: FX <fxcoudert at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 Nov 2014 16:57:08 +0100
- Subject: Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran
- Authentication-results: sourceware.org; auth=none
- References: <CAO9iq9HTtPAM-ronwWCJWv7LnSbvg9sd=9oE-RqRQHEyevG7+w at mail dot gmail dot com> <99A3CFB6-238A-45FE-87B0-03EFE55185ED at gmail dot com> <CAO9iq9H2OEoskfQXfCBosBhMeTbAzYWgtnuONPpDOm+fW4_aEQ at mail dot gmail dot com>
On Thu, Nov 13, 2014 at 02:05:52PM +0200, Janne Blomqvist wrote:
> Thanks for the quick review, committed as r217480.
This broke bootstrap because of implicit declaration of free.
The following (untested) should fix it, ok for trunk?
2014-11-13 Marek Polacek <polacek@redhat.com>
* intrinsics/access.c: Include <stdlib.h>.
* intrinsics/chdir.c: Likewise.
* intrinsics/chmod.c: Likewise.
diff --git gcc/intrinsics/access.c gcc/intrinsics/access.c
index 65a0a10..0c18da0 100644
--- gcc/intrinsics/access.c
+++ gcc/intrinsics/access.c
@@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgfortran.h"
#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
diff --git gcc/intrinsics/chdir.c gcc/intrinsics/chdir.c
index 87419a8..193e482 100644
--- gcc/intrinsics/chdir.c
+++ gcc/intrinsics/chdir.c
@@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgfortran.h"
#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
diff --git gcc/intrinsics/chmod.c gcc/intrinsics/chmod.c
index c42fa8c..bdcb676 100644
--- gcc/intrinsics/chmod.c
+++ gcc/intrinsics/chmod.c
@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined(HAVE_SYS_STAT_H)
#include <string.h> /* For memcpy. */
+#include <stdlib.h> /* For free. */
#include <sys/stat.h> /* For stat, chmod and umask. */
Marek