This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28399] New: Implement ftnchek-like warnings
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2006 22:07:31 -0000
- Subject: [Bug fortran/28399] New: Implement ftnchek-like warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There are some useful warnings that gfortran could issue.
Examples:
$ cat chk.f
program main
double precision a
real b
b = 2.3**(2/3)
a = 4.3*1d5
print *,a,b
b = 1.23456789012345
print *,4**(-3)
end
$ ftnchek chk.f
FTNCHEK Version 3.3 November 2004
File chk.f:
4 b = 2.3**(2/3)
^
Warning near line 4 col 18 file chk.f: integer const expr yields result of 0
^
Warning near line 4 col 14 file chk.f: integer quotient expr (2/3) used in
exponent
5 a = 4.3*1d5
^
Warning near line 5 col 14 file chk.f: promotion may not give desired
precision: real const 4.3 * dble const 1D5
7 b = 1.23456789012345
^
Warning near line 7 col 11 file chk.f: Single-precision real constant has more
digits than are stored
8 print *,4**(-3)
^
Warning near line 8 col 16 file chk.f: integer const expr yields result of 0
0 syntax errors detected in file chk.f
5 warnings issued in file chk.f
--
Summary: Implement ftnchek-like warnings
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28399