This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: spurious warning for -Wconversion?
- From: Tobias Burnus <burnus at net-b dot de>
- To: Brian Barnes <bcbarnes at gmail dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 28 Jan 2008 21:34:26 +0100
- Subject: Re: spurious warning for -Wconversion?
- References: <40537C58-61F5-4862-B9EC-88D3F3E3FCAA@gmail.com>
Hi Brian,
Brian Barnes wrote:
nell:~/work/bit barnes$ gfortran -Wconversion -o t.x testcase.f
testcase.f:7.16:
do i=1_8,n
1
Warning: Conversion from INTEGER(4) to INTEGER(8) at (1)
The problem is that the iterator step variable is INTEGER(4) [implicitly
added "1_4" ("gfc_int_expr (1);")]:
do i = 1_8, n, 1_4
Something like the following should work:
Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c (revision 131912)
+++ gcc/fortran/match.c (working copy)
@@ -958,6 +965,8 @@ gfc_match_iterator (gfc_iterator *iter,
if (gfc_match_char (',') != MATCH_YES)
{
e3 = gfc_int_expr (1);
+ if (var->ts.type == BT_INTEGER)
+ e3->ts.kind = var->ts.kind;
goto done;
}
Can you fill a bug report?
> I am looking forward to the release of 4.3.0!
We also, though we still could fix a few regressions. (Mostly done.)
Tobias