https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77504
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
Depends on| |106089
--- Comment #32 from kargl at gcc dot gnu.org ---
(In reply to Walter Spector from comment #31)
> Super simple test case:
>
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran --version
> GNU Fortran (GCC) 14.0.1 20240115 (experimental)
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> wws@w6ws-4:~/computer/fortran/tests$ cat a.f90
> program catenate_test
> implicit none
>
> integer, allocatable :: a(:)
>
> a = (/ 1, 3, 5 /)
>
> print *, 'size(a) =', size (a)
> print *, 'a =', a
>
> end program
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -o a a.f90
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -Wall -o a a.f90
> a.f90:6:19:
>
> 6 | a = (/ 1, 3, 5 /)
> | ^
> Warning: ‘a.offset’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
>
> 4 | integer, allocatable :: a(:)
> | ^
> note: ‘a’ declared here
> a.f90:6:19:
>
> 6 | a = (/ 1, 3, 5 /)
> | ^
> Warning: ‘a.dim[0].lbound’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
>
> 4 | integer, allocatable :: a(:)
> | ^
> note: ‘a’ declared here
> a.f90:6:19:
>
> 6 | a = (/ 1, 3, 5 /)
> | ^
> Warning: ‘a.dim[0].ubound’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
>
> 4 | integer, allocatable :: a(:)
> | ^
> note: ‘a’ declared here
> a.f90:6:19:
>
> 6 | a = (/ 1, 3, 5 /)
> | ^
> Warning: ‘a.dim[0].lbound’ may be used uninitialized [-Wmaybe-uninitialized]
> a.f90:4:30:
>
> 4 | integer, allocatable :: a(:)
> | ^
> note: ‘a’ declared here
> a.f90:6:19:
>
> 6 | a = (/ 1, 3, 5 /)
> | ^
> Warning: ‘a.dim[0].ubound’ may be used uninitialized [-Wmaybe-uninitialized]
> a.f90:4:30:
>
> 4 | integer, allocatable :: a(:)
> | ^
> note: ‘a’ declared here
> wws@w6ws-4:~/computer/fortran/tests$ ./a
> size(a) = 3
> a = 1 3 5
> wws@w6ws-4:~/computer/fortran/tests$
See ttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=106089
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106089
[Bug 106089] false positives with -Wuninitialized for allocation on assignment