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

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).