This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28105] Check for memory allocations bigger than size_t
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 1 Dec 2010 11:04:18 +0000
- Subject: [Bug fortran/28105] Check for memory allocations bigger than size_t
- Auto-submitted: auto-generated
- References: <bug-28105-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28105
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-01 11:04:06 UTC ---
I have played a bit around with the following (which has to be compiled on a
system with 32bit size_t):
real(8), dimension(1024*1024*1024) :: m
m(1)= 0
print *, 1024*1024*1024 ! * 8 -> overflow
print *, huge(3)
print *, 2_8**32
print *, 4_8*1024*1024*1024
end
However, I fail to get any compile- or run-time error. Expected: As with the
following code, one gets a compile-time error:
$ gfortran -m32 hjff3.f90
.test.f90:1:0: error: size of variable âmâ is too large
real(8), dimension(huge(3)) :: m
m(1)= 0
end