mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/35754 (-std=f95: Reject "1P2E12.4" w/o a comma after the "P")
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35754 * io.c (check_format): Add checks for comma and the allowed format specifiers after the 'P' specifier. Fix typo in error message and adjust locus. From-SVN: r151045
This commit is contained in:
parent
a14e5b7e0e
commit
e523d8bcf7
|
@ -1,3 +1,10 @@
|
||||||
|
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/35754
|
||||||
|
* io.c (check_format): Add checks for comma and the allowed
|
||||||
|
format specifiers after the 'P' specifier. Fix typo in error message
|
||||||
|
and adjust locus.
|
||||||
|
|
||||||
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/37446
|
PR fortran/37446
|
||||||
|
|
|
@ -687,20 +687,35 @@ data_desc:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FMT_P:
|
case FMT_P:
|
||||||
if (pedantic)
|
/* Comma after P is allowed only for F, E, EN, ES, D, or G.
|
||||||
|
10.1.1 (1). */
|
||||||
|
t = format_lex ();
|
||||||
|
if (t == FMT_ERROR)
|
||||||
|
goto fail;
|
||||||
|
if (gfc_option.allow_std < GFC_STD_F2003 && t != FMT_COMMA
|
||||||
|
&& t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES
|
||||||
|
&& t != FMT_D && t != FMT_G)
|
||||||
|
{
|
||||||
|
error = _("Comma required after P descriptor");
|
||||||
|
goto syntax;
|
||||||
|
}
|
||||||
|
if (t != FMT_COMMA)
|
||||||
{
|
{
|
||||||
t = format_lex ();
|
|
||||||
if (t == FMT_ERROR)
|
|
||||||
goto fail;
|
|
||||||
if (t == FMT_POSINT)
|
if (t == FMT_POSINT)
|
||||||
{
|
{
|
||||||
error = _("Repeat count cannot follow P descriptor");
|
t = format_lex ();
|
||||||
|
if (t == FMT_ERROR)
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
if (t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES && t != FMT_D
|
||||||
|
&& t != FMT_G)
|
||||||
|
{
|
||||||
|
error = _("Comma required after P descriptor");
|
||||||
goto syntax;
|
goto syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
saved_token = t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saved_token = t;
|
||||||
goto optional_comma;
|
goto optional_comma;
|
||||||
|
|
||||||
case FMT_T:
|
case FMT_T:
|
||||||
|
@ -883,13 +898,13 @@ data_desc:
|
||||||
if (t != FMT_PERIOD)
|
if (t != FMT_PERIOD)
|
||||||
{
|
{
|
||||||
/* Warn if -std=legacy, otherwise error. */
|
/* Warn if -std=legacy, otherwise error. */
|
||||||
if (mode != MODE_FORMAT)
|
|
||||||
format_locus.nextc += format_string_pos;
|
|
||||||
if (gfc_option.warn_std != 0)
|
if (gfc_option.warn_std != 0)
|
||||||
{
|
{
|
||||||
error = _("Period required in format specifier at %L");
|
error = _("Period required in format specifier");
|
||||||
goto syntax;
|
goto syntax;
|
||||||
}
|
}
|
||||||
|
if (mode != MODE_FORMAT)
|
||||||
|
format_locus.nextc += format_string_pos;
|
||||||
gfc_warning ("Period required in format specifier at %L",
|
gfc_warning ("Period required in format specifier at %L",
|
||||||
&format_locus);
|
&format_locus);
|
||||||
saved_token = t;
|
saved_token = t;
|
||||||
|
|
Loading…
Reference in New Issue