This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]