[Bug fortran/92805] gfortran: blanks within literal constants should not be allowed

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 19 17:29:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #6 from kargl at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #5)
> Hi Steve,
> 
> > Index: gcc/fortran/primary.c
> > ===================================================================
> > --- gcc/fortran/primary.c	(revision 279052)
> > +++ gcc/fortran/primary.c	(working copy)
> > @@ -90,16 +90,22 @@ match_kind_param (int *kind, int *is_iso_c)
> >  static int
> >  get_kind (int *is_iso_c)
> >  {
> > +  char c;
> >    int kind;
> >    match m;
> >  
> >    *is_iso_c = 0;
> >  
> > +  c = gfc_peek_ascii_char ();
> > +  if (gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> > +    return -2;
> > +
> >    if (gfc_match_char ('_') != MATCH_YES)
> >      return -2;
> >  
> > -  m = match_kind_param (&kind, is_iso_c);
> > -  if (m == MATCH_NO)
> > +  c = gfc_peek_ascii_char ();
> > +  if ((gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> > +      || (m = match_kind_param (&kind, is_iso_c)) == MATCH_NO)
> >      gfc_error ("Missing kind-parameter at %C");
> >  
> >    return (m == MATCH_YES) ? kind : -1;
> 
> That patch looks good. Do you plan on submitting it?

No.  I do not do git and have little time/need/interest
in learning.


More information about the Gcc-bugs mailing list