Hi Tobias, >> In addition to this, the patch contains a part which concerns the >> function 'gfc_terminal_width': Currently this returns a fixed value of >> 80, which means that all source lines are trimmed to 80 characters in >> the error messages. I increased this default value to 132 (in order to >> accommodate standard free-format lines), and added a part which tries >> to determine the terminal width from the environment variable $COLUMNS >> (the corresponding code was borrowed from gcc/opts.c). > > > I think it is a good idea to use $COLUMNS (which is, e.g. set by the shell > under Unix); however, if the variable is not available, I think one should > keep the value 80. > > >> 2013-05-30 Janus Weil<ja...@gcc.gnu.org> >> >> PR fortran/57217 >> * gfortran. h (gfc_terminal_width): Remove prototype. > > Spurious space before "h". > >> -/* Given two symbols that are formal arguments, compare their ranks >> - and types. Returns nonzero if they have the same rank and type, >> - zero otherwise. */ >> +static int >> +compare_type (gfc_symbol *s1, gfc_symbol *s2) >> +{ >> + if (s1->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK) >> + || s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK)) >> + return 1; >> + return gfc_compare_types (&s1->ts, &s2->ts) >> + || s1->ts.type == BT_ASSUMED || s2->ts.type == BT_ASSUMED; >> +} > > > I admit it is a slightly different issue, but it came up in the same thread: > I believe it should be: > > + if (s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK)) > + return 1; > ... > + return s2->ts.type == BT_ASSUMED || gfc_compare_types (&s1->ts, &s2->ts); > > > That should fix the issue with the two of the three test cases at > http://gcc.gnu.org/ml/fortran/2013-05/msg00089.html > >> -compare_type_rank (gfc_symbol *s1, gfc_symbol *s2) >> +compare_rank (gfc_symbol *s1, gfc_symbol *s2) >> { >> gfc_array_spec *as1, *as2; >> int r1, r2; >> @@ -533,11 +541,21 @@ static int >> && (!as2 || as2->type != AS_ASSUMED_RANK)) >> return 0; /* Ranks differ. */ > > > Ditto here: > if (r1 != r2 > && (!as1 || as1->type != AS_ASSUMED_RANK) > && (!as2 || as2->type != AS_ASSUMED_RANK)) > return 0; /* Ranks differ. */ > > where the "!as1" line should be removed, which fixes the third of the three > test cases of the email mentioned above. > > > Otherwise, the patch looks okay.
Thanks for the review. I have updated the patch according to your comments and committed as r199475 (including the assumed-type/rank bits, which also fix PR 54190 by the way). Cheers, Janus