2008-06-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/36420, 36422
* io.c (check_format): Add new error message for zero width. Use new
error message for FMT_A and with READ, FMT_G. Allow FMT_G with WRITE
except when -std=F95 and -std=F2003.
From-SVN: r136544
+2008-06-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/36420, 36422
+ * io.c (check_format): Add new error message for zero width.
+ Use new error message for FMT_A and with READ, FMT_G. Allow
+ FMT_G with WRITE except when -std=F95 and -std=F2003.
+
2008-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/36437
const char *nonneg_required = _("Nonnegative width required");
const char *unexpected_element = _("Unexpected element");
const char *unexpected_end = _("Unexpected end of format string");
+ const char *zero_width = _("Zero width in format descriptor");
const char *error;
format_token t, u;
t = format_lex ();
if (t == FMT_ERROR)
goto fail;
+ if (t == FMT_ZERO)
+ {
+ error = zero_width;
+ goto syntax;
+ }
if (t != FMT_POSINT)
saved_token = t;
break;
case FMT_G:
case FMT_EXT:
u = format_lex ();
+ if (t == FMT_G && u == FMT_ZERO)
+ {
+ if (is_input)
+ {
+ error = zero_width;
+ goto syntax;
+ }
+ else
+ return gfc_notify_std (GFC_STD_F2008, "Fortran F2008: 'G0' in "
+ "format at %C");
+ }
+
if (u == FMT_ERROR)
goto fail;
if (u != FMT_POSINT)
if (open->round)
{
/* When implemented, change the following to use gfc_notify_std F2003. */
- gfc_error ("F2003 Feature: ROUND= specifier at %C not implemented");
+ gfc_error ("Fortran F2003: ROUND= specifier at %C not implemented");
goto cleanup;
if (open->round->expr_type == EXPR_CONSTANT)