Software Archive
Read-only legacy content
17061 Discussions

implicit conversions

russell66
Beginner
383 Views
Is there a way to get the compiler to warn you when an implicit conversion is taking place.

I am in the process of modernizing a legacy code that stored many values in variables of the wrong type ( ints in reals for the most part), and would
like the compiler to help as much as possible.
for example:
INTEGER :: iVal
REAL :: rVal

rVal = 1 ! should be initialized with 1.0
iVal = rVal ! should be INT(rVal)

rVal = REAL(iVal) ! OK, but why use this stmt...

Thanks

Russ Johns
0 Kudos
1 Reply
Steven_L_Intel1
Employee
383 Views
No - implicit conversions are part of the Fortran standard. But we've had several requests for such a feature and might add it in the future as part of a set of user-settable rules.

You might look at something like the free FORCHEK tool, which can be very picky if you ask it to.

Steve
0 Kudos
Reply