- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The legacy application that I am porting from g77 to Intel Fortran has many tests of the form:
IF (INTEGER_VAR)
and, since the FORTRAN is generated by RATFOR, many more tests of the form
IF (.NOT.(INTEGER_VAR)) CONTINUE . . .
I would like to detect these with a compiler warning, but even '-warn all' does not flag these. Is there a flag that I can use?
Side note: g77 detects these by default, but not when the -fugly flag is used. And when you use that flag, it looks like some of the tests are executed incorrectly.
Thanks,
Jay
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the -stand option. With this option, attempting to compile
subroutine tst(l,m) integer, intent(in) :: l integer, intent(out) :: m m = .not. l if (m) then write(*,*)' m is true' else write(*,*)' m is false' endif return end subroutine tst
gives the warning messages
ilog.f90(4): warning #6188: Fortran 2003 requires a LOGICAL data type in this context.m = .not. l ----------^
ilog.f90(5): warning #6188: Fortran 2003 requires a LOGICAL data type in this context.if (m) then ----^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fantastic! Thanks much.
I'm almost frightened at the prospect of finding all the non-standard features . . . :--)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't blame ratfor for this. I've never seen that extension used with ratfor. By the way, gfortran should be more reliable than g77 on many current platforms. It may prove a useful intermediate step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Howdy. No blame here. I meant that since RATFOR translates something like:
if (integer_var) {
do this }
rest of program
into something like:
IF (.NOT.(INTEGER_VAR)) GO TO label
DO THIS
label: rest of program
as do most compilers that generate assembly language, or translators that generate C, this feature manifests itself with ".NOT" more often that with the "not"-less expression.
Regarding gfortran, it does not have the options that would be required to compile a working program from the FORTRAN 66/77 hybrid that the legacy program employs. In a sense, Intel Fortran might theoretically be a stepping stone to an eventual gfortran implementation, as it supports the full range of FORTRAN/Fortran dialects.
JayB

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