- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When compiling Fortran, I have warning 6075 for a relational expression as logical argument to a function. The program is performing as expected however. Should the kind of the logical argument be modified ? Thank you for answering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a possible reason for such a warning. Suppose you have a subprogram one of whose arguments is a logical variable. A logical value may be passed into the subprogram through the argument, and the subprogram may change that logical value before returning. However, this is not possible if a logical expression had been passed as the actual argument -- you cannot return a changed value to an expression.
The compiler warns against this type of error, and similarly for expressions of any type passed as actual arguments when the dummy argument is liable to be overwritten. If you are sure that the subprogram will not attempt to overwrite such a dummy argument, ignore the warning.
If this explanation does not seem right to you, show some relevant lines of code and we can discuss them. I think that 6075 is the number for reporting type/kind mismatches between actual and dummy arguments.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess you mean to ask a question, but the message contains nothing more than that particular warning. Could you provide more information? Perhaps a code fragment that caused the compiler to issue this warning?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a possible reason for such a warning. Suppose you have a subprogram one of whose arguments is a logical variable. A logical value may be passed into the subprogram through the argument, and the subprogram may change that logical value before returning. However, this is not possible if a logical expression had been passed as the actual argument -- you cannot return a changed value to an expression.
The compiler warns against this type of error, and similarly for expressions of any type passed as actual arguments when the dummy argument is liable to be overwritten. If you are sure that the subprogram will not attempt to overwrite such a dummy argument, ignore the warning.
If this explanation does not seem right to you, show some relevant lines of code and we can discuss them. I think that 6075 is the number for reporting type/kind mismatches between actual and dummy arguments.

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