Commit d289d284 by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR fortran/52313 (useless error message for old version of .mod file)

	PR fortran/52313
	* module.c (gfc_use_module): Improve error messages.

From-SVN: r184864
parent 6230987e
2012-03-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/52313
* module.c (gfc_use_module): Improve error messages.
2012-03-03 Tobias Burnus <burnus@net-b.de> 2012-03-03 Tobias Burnus <burnus@net-b.de>
PR fortran/48820 PR fortran/48820
......
...@@ -6090,22 +6090,17 @@ gfc_use_module (gfc_use_list *module) ...@@ -6090,22 +6090,17 @@ gfc_use_module (gfc_use_list *module)
parse_name (c); parse_name (c);
if ((start == 1 && strcmp (atom_name, "GFORTRAN") != 0) if ((start == 1 && strcmp (atom_name, "GFORTRAN") != 0)
|| (start == 2 && strcmp (atom_name, " module") != 0)) || (start == 2 && strcmp (atom_name, " module") != 0))
gfc_fatal_error ("File '%s' opened at %C is not a GFORTRAN module " gfc_fatal_error ("File '%s' opened at %C is not a GNU Fortran"
"file", filename); " module file", filename);
if (start == 3) if (start == 3)
{ {
if (strcmp (atom_name, " version") != 0 if (strcmp (atom_name, " version") != 0
|| module_char () != ' ' || module_char () != ' '
|| parse_atom () != ATOM_STRING) || parse_atom () != ATOM_STRING
gfc_fatal_error ("Parse error when checking module version" || strcmp (atom_string, MOD_VERSION))
" for file '%s' opened at %C", filename); gfc_fatal_error ("Cannot read module file '%s' opened at %C,"
" because it was created by an older"
if (strcmp (atom_string, MOD_VERSION)) " version of GNU Fortran", filename);
{
gfc_fatal_error ("Wrong module version '%s' (expected '%s') "
"for file '%s' opened at %C", atom_string,
MOD_VERSION, filename);
}
free (atom_string); free (atom_string);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment