- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Is it possible to get a warning from the compiler in the cases
a) Integer division, eg
nRealVar = iInteger1/iInteger2;
or more generally when mixing types in algebraic expressions??
b) Complex assigned to real, eg
real nR
complex nQ
...
nR = nQ;
I have tried to redefine the division operator /, but it seems
that '/' is too intrinsic to be redefined via INTERFACE ...
Any hints are welcome
Regards
Gunnar Taraldsen
SINTEF Telecom and Informatics
Is it possible to get a warning from the compiler in the cases
a) Integer division, eg
nRealVar = iInteger1/iInteger2;
or more generally when mixing types in algebraic expressions??
b) Complex assigned to real, eg
real nR
complex nQ
...
nR = nQ;
I have tried to redefine the division operator /, but it seems
that '/' is too intrinsic to be redefined via INTERFACE ...
Any hints are welcome
Regards
Gunnar Taraldsen
SINTEF Telecom and Informatics
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, the compiler does not implement a warning for this. These operations are allowed under the Fortran standard and might be used in valid programs.
I'll add to our wish list an optional warning for mixed-mode arithmetic. I could see that this might be useful to some people.
Steve
I'll add to our wish list an optional warning for mixed-mode arithmetic. I could see that this might be useful to some people.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
... but, it doesn't do f90 (or f95) outside of implicit none, do...end do, end subroutine, select case, and maybe a few minor others. Quite the drawback, imo. (an almost universal drawback among third party Fortran static analyzers.)
-John
-John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John, I have not tested the latest version but this is what they promis:
Status as of 4 February 2001
ftnchek is now at version 3.0.2
Some new features in version 3.0:
1. Statement labels are now processed, instead of being
ignored as formerly. Tables of label definitions and
cross-references can be printed, and warnings about
incorrect or suspicious label usage are produced.
This new feature was added by Heba Elsayed.
2. The SELECT CASE construct is now accepted. The syntax
is as defined in Fortran 90. This new feature was
added by John Bollinger.
3. The END PROGRAM, END FUNCTION, END SUBROUTINE and END
BLOCKDATA statements are accepted. No checking for
balance is done.
4. Source code can be in Fortran 90 free format or tradi-
tional fixed format. Also, a semicolon is allowed as
a statement separator.
5. The ftnpp program has been unbundled from the distri-
bution. It is available from the same places as
ftnchek.
Regards,
Sabalan.
Status as of 4 February 2001
ftnchek is now at version 3.0.2
Some new features in version 3.0:
1. Statement labels are now processed, instead of being
ignored as formerly. Tables of label definitions and
cross-references can be printed, and warnings about
incorrect or suspicious label usage are produced.
This new feature was added by Heba Elsayed.
2. The SELECT CASE construct is now accepted. The syntax
is as defined in Fortran 90. This new feature was
added by John Bollinger.
3. The END PROGRAM, END FUNCTION, END SUBROUTINE and END
BLOCKDATA statements are accepted. No checking for
balance is done.
4. Source code can be in Fortran 90 free format or tradi-
tional fixed format. Also, a semicolon is allowed as
a statement separator.
5. The ftnpp program has been unbundled from the distri-
bution. It is available from the same places as
ftnchek.
Regards,
Sabalan.
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