This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE
- 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: Tue, 15 May 2012 09:32:55 +0000
- Subject: [Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53357
Bug #: 53357
Summary: Add -fcheck=bounds for character type-spec in ALLOCATE
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Example: The following is invalid as the length does not match:
integer :: i
i = 5
block
character(len=i), allocatable :: str
allocate (character(len=3) :: str)
end block
end
* * *
That's already correctly detected for compile-time constants:
character(len=5), allocatable :: str
allocate (character(len=3) :: str)
end
Error: Allocating str at (1) with type-spec requires the same character-length
parameter as in the declaration
However, the compile-time version could also print the bounds.