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

            Bug ID: 125801
           Summary: False positive for [-Wunused-intent-out]
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manfred99 at gmx dot ch
  Target Milestone: ---

cat > unused.f <<EOF
      program unused

      character(len=20) c_val
      integer val

      CALL getarg(1,c_val)
      !!print*,c_val
      READ(c_val,*) val
      print*,val

      end
EOF

#> /usr/local/gfortran-17/bin/gfortran -Wall -W unused.f -o unused
unused.f:6:20:

    6 |       CALL getarg(1,c_val)
      |                    1
Warning: Variable 'c_val' passed to INTENT(OUT) argument at (1) but value never
used [-Wunused-intent-out]


It seems that the READ() function is not considered to read the variable.

Reply via email to