public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48958] New: Add runtime diagnostics for SIZE intrinsic function
@ 2011-05-11  8:09 thenlich at users dot sourceforge.net
  2015-10-14 21:45 ` [Bug libfortran/48958] " anlauf at gmx dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-05-11  8:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48958

           Summary: Add runtime diagnostics for SIZE intrinsic function
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


As has been brought up before (Bug 20406), the SIZE intrinsic returns an
unpredictable result if the argument is an unallocated allocatable or a pointer
that is not associated.

While this is perfectly standard-conforming behaviour, it would be helpful in
program development to have SIZE throw a runtime error if this condition
occurs.

I.e. SIZE should first check if an array is ALLOCATED or a pointer is
ASSOCIATED and abort with a runtime error if that is not the case.

Fortran 2008:

13.7.156 SIZE (ARRAY [, DIM, KIND])
3 Arguments.
ARRAY shall be an array of any type. It shall not be an unallocated allocatable
variable or a pointer that is not associated. If ARRAY is an assumed-size
array, DIM shall be present with a value less than the rank of ARRAY.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-16 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11  8:09 [Bug libfortran/48958] New: Add runtime diagnostics for SIZE intrinsic function thenlich at users dot sourceforge.net
2015-10-14 21:45 ` [Bug libfortran/48958] " anlauf at gmx dot de
2015-10-15  9:36 ` dominiq at lps dot ens.fr
2020-11-14 22:16 ` anlauf at gcc dot gnu.org
2020-11-16 21:01 ` cvs-commit at gcc dot gnu.org
2020-11-16 22:31 ` [Bug fortran/48958] " anlauf at gcc dot gnu.org

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