Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Weird compilation message. Bug ?

WSinc
New Contributor I
211 Views

I get an error 6385 when I compile this. Of course I should have
typed OK2 as logical, but why does it give me this message
instead of one pertaining to LOGICAL variables?

The message goes away when I type OK2 as logical.......

integer*4 i,j

logical OK

ok=i.gt.14.or.j.le.3 .or. ok2

end

0 Kudos
3 Replies
Steven_L_Intel1
Employee
211 Views
Not a bug, though I agree the message, "The highest data type rank permitted is INTEGER(KIND=8)", isn't terribly clear. Part of the problem here is that we have an extension that allows free conversion between integer and logical types, so if ok2 was an integer, either implicitly or explicitly, you would get no error, though the results might not be what you want. Since ok2 is implicitly REAL, the compiler is saying "our free conversion stops at INTEGER(8)".

If you asked for standards checking, you'd also get this:

warning #6192: Fortran 2003 does not allow this data type conversion.

which might be a bit more obvious.
0 Kudos
WSinc
New Contributor I
211 Views
Well, since OK2 is sitting there by itself
(not in a comparison expression) shouldn't the compiler assume it would have to be LOGICAL?

If it is typed INTEGER, that would resolve the confusion.
0 Kudos
Steven_L_Intel1
Employee
211 Views
No, the language does not make such assumptions. It says that since it starts with an O, it's REAL.
0 Kudos
Reply