Quantcast
Channel: Intel® Fortran Composer XE
Viewing all articles
Browse latest Browse all 1424

Warnings for numerical operations on logical objects

$
0
0

I'm not sure whether the compiler is required to diagnose this sort of silliness or not with /stand, but it would be nice if it did.

PROGRAM LogicalOperations
  IMPLICIT NONE
  LOGICAL :: la, lb

  la = .TRUE.
  lb = .FALSE.

  PRINT *, -la
  PRINT *, +la
  PRINT *, la + lb
  PRINT *, la - lb
  PRINT *, la * lb
  PRINT *, lb / la
  PRINT *, la ** lb
END PROGRAM LogicalOperations

 

>ifort /check:all /warn:all /standard-semantics /stand "2014-09-21 logical-operations.f90"
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2014-09-21 logical-operations.exe"
-subsystem:console"2014-09-21 logical-operations.obj"

 


Viewing all articles
Browse latest Browse all 1424

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>