+2017-09-29 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR fortran/25071
+ * interface.c (compare_actual_formal): Change warnings to errors
+ when "Actual argument contains too few elements for dummy
+ argument", unless -std=legacy is used.
+
2017-09-27 Thomas Schwinge <thomas@codesourcery.com>
* lang.opt <Wdo-subscript>: End help text with a period.
f->sym->name, actual_size, formal_size,
&a->expr->where);
else if (where)
- gfc_warning (OPT_Wargument_mismatch,
- "Actual argument contains too few "
- "elements for dummy argument %qs (%lu/%lu) at %L",
- f->sym->name, actual_size, formal_size,
- &a->expr->where);
+ {
+ /* Emit a warning for -std=legacy and an error otherwise. */
+ if (gfc_option.warn_std == 0)
+ gfc_warning (OPT_Wargument_mismatch,
+ "Actual argument contains too few "
+ "elements for dummy argument %qs (%lu/%lu) "
+ "at %L", f->sym->name, actual_size,
+ formal_size, &a->expr->where);
+ else
+ gfc_error_now ("Actual argument contains too few "
+ "elements for dummy argument %qs (%lu/%lu) "
+ "at %L", f->sym->name, actual_size,
+ formal_size, &a->expr->where);
+ }
return false;
}