This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30402] New: Bounds checking for string functions
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jan 2007 10:57:07 -0000
- Subject: [Bug fortran/30402] New: Bounds checking for string functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Lots of bounds-checking errors in this program...
$ cat string_check.f90
program main
character (len=4) :: a,b
character (len=1) :: c
a = 'aa '
b = trim(a) ! RHS is too short
a = repeat('b', 2) ! RHS is too short
c = trim(a) ! LHS is too short, string out of bounds
c = repeat('b', 2) ! LHS is too short, string out of bounds
c = a ! LHS is too short, string out of bounds
end program main
$ gfortran -fbounds-check string_check.f90
$ ./a.out
$
--
Summary: Bounds checking for string functions
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
OtherBugsDependingO 27766
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30402