[Bug fortran/41918] New: Superflous warning "was declared INTENT(OUT) but was not set"

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Nov 2 23:39:00 GMT 2009


For the following program, one can argue whether it makes sense to warn or not.

  ELEMENTAL SUBROUTINE CRTM_Cloud_Destroy( Cloud )
                                                1
Warning: Dummy argument 'cloud' at (1) was declared INTENT(OUT) but was not set

Reason to warn:
* One does not use the variable, which is usually not what is intended

Reasons not to warn:
* Its components are deallocated and the default values are set. Thus the
argument is used.

Cf.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/38d5995652c080a9#


module m
  TYPE :: CRTM_Cloud_type
    ! Dimension values
    INTEGER :: n_Layers = 0
    ! Cloud type
    INTEGER :: Type = 1
    ! Cloud state variables
    REAL, ALLOCATABLE :: Effective_Radius(:)   ! Units are microns
    REAL, ALLOCATABLE :: Effective_Variance(:) ! Units are microns2
    REAL, ALLOCATABLE :: Water_Content(:)      ! Units are kg/m2
  END TYPE CRTM_Cloud_type
contains
  ELEMENTAL SUBROUTINE CRTM_Cloud_Destroy( Cloud )
    TYPE(CRTM_Cloud_type), INTENT(OUT) :: Cloud
  END subroutine CRTM_Cloud_Destroy
end module


-- 
           Summary: Superflous warning "was declared INTENT(OUT) but was not
                    set"
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41918



More information about the Gcc-bugs mailing list