This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Handling of .and. and .or. expressions
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 13 Jun 2018 10:41:37 +0200
- Subject: Re: [patch, fortran] Handling of .and. and .or. expressions
Hi Thomas,
As I said in one of the PRs, I don’t like the warnings triggering with -Wall.
Also I don’t understand what is special with ASSOCIATED, as shown by the following code
MODULE M1
TYPE T1
LOGICAL :: T=.FALSE.
END TYPE T1
CONTAINS
SUBROUTINE S1(m)
TYPE(T1), allocatable :: m
IF (ALLOCATED(m) .AND. m%T) THEN
WRITE(6,*) "X"
ENDIF
END SUBROUTINE
END MODULE
USE M1
TYPE(T1), allocatable :: m
CALL S1(m)
allocate(m)
CALL S1(m)
m%t = .true.
CALL S1(m)
deallocate(m)
END
In addition I don’t understand the associated warning: in short-circuit evaluation ASSOCIATED(m) (or ALLOCATED(m)) does protect m%T to be accessed.
Cheers,
Dominique