This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch, fortran] PR24268 whitespace in format strings.


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


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