[Bug fortran/86313] make -Warray-temporaries less noisy
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 25 14:23:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86313
--- Comment #1 from janus at gcc dot gnu.org ---
Another case for which I don't see why one should throw a warning (but I get
two):
program p
implicit none
character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)
if (.not. check(formats)) then
print *, "error"
end if
contains
logical function check(setStr)
character(len=*), dimension(:), contiguous, intent(in) :: setStr
check = .false.
end function
end
c1.f90:4:48:
character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)
1
Warning: Creating array temporary at (1) [-Warray-temporaries]
c1.f90:4:48:
character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)
1
Warning: Creating array temporary at (1) for argument ‘setstr’
[-Warray-temporaries]
It seems like one is for the assignment, and another is for the function call
(with wrong locus). Without 'contiguous' only one remains.
More information about the Gcc-bugs
mailing list