This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: spurious warning for -Wconversion?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]