This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: I/O library and testing
- From: Tobias SchlÃter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: FX Coudert <Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>
- Date: Sun, 27 Feb 2005 17:04:05 +0100
- Subject: Re: I/O library and testing
- References: <4221E558.5030307@lcp.u-psud.fr>
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