public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE
@ 2012-05-15 9:41 burnus at gcc dot gnu.org
2014-07-20 8:57 ` [Bug fortran/53357] " dominiq at lps dot ens.fr
2015-10-10 9:08 ` dominiq at lps dot ens.fr
0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-15 9:41 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/53357] Add -fcheck=bounds for character type-spec in ALLOCATE
2012-05-15 9:41 [Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE burnus at gcc dot gnu.org
@ 2014-07-20 8:57 ` dominiq at lps dot ens.fr
2015-10-10 9:08 ` dominiq at lps dot ens.fr
1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-07-20 8:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53357
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2014-07-20
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Compiling the first test in comment 0 gives an error with 4.7 up to trunk
(4.10)
Error: Allocating str at (1) with type-spec requires the same character-length
parameter as in the declaration
even if i=3 or with the following code
integer :: i
i = 3
call sub(i)
end
subroutine sub(i)
character(len=i), allocatable :: str
allocate (character(len=3) :: str)
end
This does not seem correct (unless I am missing something).
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/53357] Add -fcheck=bounds for character type-spec in ALLOCATE
2012-05-15 9:41 [Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE burnus at gcc dot gnu.org
2014-07-20 8:57 ` [Bug fortran/53357] " dominiq at lps dot ens.fr
@ 2015-10-10 9:08 ` dominiq at lps dot ens.fr
1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-10 9:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53357
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at r228660.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-10 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 9:41 [Bug fortran/53357] New: Add -fcheck=bounds for character type-spec in ALLOCATE burnus at gcc dot gnu.org
2014-07-20 8:57 ` [Bug fortran/53357] " dominiq at lps dot ens.fr
2015-10-10 9:08 ` dominiq at lps dot ens.fr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).