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

Fortran compiler

GKChesterton
Beginner
259 Views
Hello,
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.
0 Kudos
1 Solution
mecej4
Black Belt
243 Views

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.

View solution in original post

2 Replies
Arjen_Markus
Valued Contributor III
250 Views

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?

mecej4
Black Belt
244 Views

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.

Reply