[patch, fortran] PR24268 whitespace in format strings.
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sat Dec 17 02:05:00 GMT 2005
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
More information about the Gcc-patches
mailing list