[Bug fortran/37319] [4.4 regression] gfortran.dg/function_kinds_5.f90 fails

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Nov 24 20:01:00 GMT 2008



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2008-11-24 19:59 -------
> This looks like a missing or wrong initialisation.

Confirmed, it's 'name' in match_deferred_characteristics:

  char name[GFC_MAX_SYMBOL_LEN + 1];
[...]
  /* Set the function locus correctly.  If we have not found the
     function name, there is an error.  */
  gfc_match ("function% %n", name);
  if (m == MATCH_YES && strcmp (name, gfc_current_block ()->name) == 0)
    {
      gfc_current_block ()->declared_at = gfc_current_locus;
      gfc_commit_symbols ();
    }
  else
    gfc_error_check ();

gfc_match ("function% %n", name) doesn't touch 'name' so the outcome of the
string comparison is random.  Would it make sense to test the return value
of gfc_match here?


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37319



More information about the Gcc-bugs mailing list