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: I/O library and testing


FX Coudert wrote:
> I can read the following in libgfortran/io/write.c (around line 405):
> 
>    switch (ft)
>      {
> [...]
>      case FMT_E:
>      case FMT_D:
> [...]
>        if (ft = FMT_E)
>          expchar = 'E';
>        else
>          expchar = 'D';
>        break;
> 
> I can only assume that "if (ft = FMT_E)" should really be "if (ft == 
> FMT_E)", but that raises two questions: why doesn't it issue a warning 
> when building the libgfortran, and what is the extent of the testing for 
> the I/O library (I'm having a close look at it these latter days, to fix 
> a few PR).

A warning is only issued with -Wall, which isn't used when building libgfortran.

As for testing coverage, this is not a bug in a technical sense, because the
standard allows the exponent character to be either 'E' or 'D' for D formats.
 It is not a regression from g77 either, as for both E and D formats g77
prints 'E' as the exponent character.  Nevertheless, I think this should be
fixed, and I will commit the obvious patch fixing the equality test to the
mainline together with a testcase once testing finishes.  For the branch I'd
suggest removing this conditional, as the further uses of ft in the function
don't depend on FMT_E vs FMT_D.  Ok?

- Tobi


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