public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102966] New: size() returns 0 for an unallocated array,  no error message or error exit
@ 2021-10-27 17:18 b.j.braams at cwi dot nl
  2021-10-27 19:01 ` [Bug fortran/102966] " kargl at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: b.j.braams at cwi dot nl @ 2021-10-27 17:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102966

            Bug ID: 102966
           Summary: size() returns 0 for an unallocated array, no error
                    message or error exit
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b.j.braams at cwi dot nl
  Target Milestone: ---

Using GNU Fortran (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1).

The four-line test program is:

PROGRAM test
  integer, allocatable :: ar(:)
  print *, size(ar)
END PROGRAM test

I compile with flags -Wall and -fcheck=all

gfortran -Wall -fcheck=all test.f90

This produces a.out without warning, and then ./a.out just prints 0 without
error message.

The expected result for me, especially with -fcheck=all, is an error exit at
run time. Un unallocated array is not a zero-size array.

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

end of thread, other threads:[~2021-10-29  9:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 17:18 [Bug fortran/102966] New: size() returns 0 for an unallocated array, no error message or error exit b.j.braams at cwi dot nl
2021-10-27 19:01 ` [Bug fortran/102966] " kargl at gcc dot gnu.org
2021-10-27 19:20 ` anlauf at gcc dot gnu.org
2021-10-27 21:42 ` jakub at gcc dot gnu.org
2021-10-28 18:24 ` anlauf at gcc dot gnu.org
2021-10-28 18:45 ` kargl at gcc dot gnu.org
2021-10-28 19:07 ` anlauf at gcc dot gnu.org
2021-10-29  9:39 ` b.j.braams at cwi dot nl
2021-10-29  9:45 ` jakub 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).