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

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
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?

Reply via email to