- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
(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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, the language does not make such assumptions. It says that since it starts with an O, it's REAL.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page