This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR24268 whitespace in format strings.
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 17 Dec 2005 03:05:48 +0100
- Subject: Re: [patch, fortran] PR24268 whitespace in format strings.
- References: <43A33194.2070101@verizon.net>
Jerry DeLisle wrote:
> Index: io.c
> ===================================================================
> *** io.c (revision 108625)
> --- io.c (working copy)
> *************** format_lex (void)
> *** 233,239 ****
> if (ISDIGIT (c))
> value = 10 * value + c - '0';
> }
> ! while (ISDIGIT (c));
>
> unget_char ();
> token = zflag ? FMT_ZERO : FMT_POSINT;
> --- 233,239 ----
> if (ISDIGIT (c))
> value = 10 * value + c - '0';
> }
> ! while (ISDIGIT (c) || gfc_is_whitespace(c));
>
> unget_char ();
> token = zflag ? FMT_ZERO : FMT_POSINT;
This is only correct in fixed form source code, please add a check. I'm also
worried that there might be other cases, where this check is needed, or maybe
io.c's next_char needs fixing.
- Tobi