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: Jakub Jelinek <jakub at redhat dot com>
- Cc: Janne Blomqvist <blomqvist dot janne at gmail dot com>, 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 19:04:51 +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> <20141113155707 dot GR29791 at redhat dot com> <20141113155909 dot GV5026 at tucnak dot redhat dot com>
On Thu, Nov 13, 2014 at 04:59:09PM +0100, Jakub Jelinek wrote:
> On Thu, Nov 13, 2014 at 04:57:08PM +0100, Marek Polacek wrote:
> > 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.
>
> Ok, thanks.
The previous version was incomplete. The following should be.
Applying to trunk.
2014-11-13 Marek Polacek <polacek@redhat.com>
* intrinsics/access.c: Include <stdlib.h>.
* intrinsics/chdir.c: Likewise.
* intrinsics/chmod.c: Likewise.
* intrinsics/link.c: Likewise.
* intrinsics/perror.c: Likewise.
* intrinsics/rename.c: Likewise.
* intrinsics/symlnk.c: Likewise.
* intrinsics/unlink.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. */
diff --git gcc/intrinsics/link.c gcc/intrinsics/link.c
index c6084a1..dd9c470 100644
--- gcc/intrinsics/link.c
+++ gcc/intrinsics/link.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/perror.c gcc/intrinsics/perror.c
index a8f0972..2bb1305 100644
--- gcc/intrinsics/perror.c
+++ gcc/intrinsics/perror.c
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
/* SUBROUTINE PERROR(STRING)
CHARACTER(len=*), INTENT(IN) :: STRING */
diff --git gcc/intrinsics/rename.c gcc/intrinsics/rename.c
index aabf821..78c3d81 100644
--- gcc/intrinsics/rename.c
+++ gcc/intrinsics/rename.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>
diff --git gcc/intrinsics/symlnk.c gcc/intrinsics/symlnk.c
index 5c53cb7..52a3c4b 100644
--- gcc/intrinsics/symlnk.c
+++ gcc/intrinsics/symlnk.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/unlink.c gcc/intrinsics/unlink.c
index 2971a62..4752988 100644
--- gcc/intrinsics/unlink.c
+++ gcc/intrinsics/unlink.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgfortran.h"
+#include <stdlib.h>
#include <string.h>
#include <errno.h>
Marek