https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125801
--- Comment #1 from Manfred Schwarb <manfred99 at gmx dot ch> ---
Another example:
cat > td.f <<EOF
program td
INTEGER t1,t2
CALL SYSTEM_CLOCK(t1)
CALL sleep(1)
CALL SYSTEM_CLOCK(t2)
!!print*,t2,t1
print*,"Ende: ",(t2-t1)/1000.0
end
EOF
#> /usr/local/gfortran-17/bin/gfortran -Wall -W td.f -o td
td.f:4:24:
4 | CALL SYSTEM_CLOCK(t1)
| 1
Warning: Variable 't1' passed to INTENT(OUT) argument at (1) but value never
used [-Wunused-intent-out]
td.f:6:24:
6 | CALL SYSTEM_CLOCK(t2)
| 1
Warning: Variable 't2' passed to INTENT(OUT) argument at (1) but value never
used [-Wunused-intent-out]
If one uses the commented "print*,t2,t1", no warnings are shown.
It seems that even slightly "hidden" uses as in a mathematical calculation
are not considered as "used".
This is with
#> /usr/local/gfortran-17/bin/gfortran --version
GNU Fortran (GCC) 17.0.0 20260614 (experimental)
Copyright (C) 2026 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.