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.