/* Eat up the spaces and return a character. */
static char
-next_char_not_space (bool *error)
+next_char_not_space ()
{
char c;
do
{
error_element = c = next_char (NONSTRING);
if (c == '\t')
- {
- if (gfc_option.allow_std & GFC_STD_GNU)
- gfc_warning (0, "Extension: Tab character in format at %C");
- else
- {
- gfc_error ("Extension: Tab character in format at %C");
- *error = true;
- return c;
- }
- }
+ gfc_warning (OPT_Wtabs, "Nonconforming tab character in format at %C");
}
while (gfc_is_whitespace (c));
return c;
char c, delim;
int zflag;
int negative_flag;
- bool error = false;
if (saved_token != FMT_NONE)
{
return token;
}
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
negative_flag = 0;
switch (c)
/* Falls through. */
case '+':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (!ISDIGIT (c))
{
token = FMT_UNKNOWN;
do
{
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (ISDIGIT (c))
value = 10 * value + c - '0';
}
do
{
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (ISDIGIT (c))
{
value = 10 * value + c - '0';
break;
case 'T':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
switch (c)
{
case 'L':
break;
case 'S':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (c != 'P' && c != 'S')
unget_char ();
break;
case 'B':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (c == 'N' || c == 'Z')
token = FMT_BLANK;
else
break;
case 'E':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (c == 'N' )
token = FMT_EN;
else if (c == 'S')
break;
case 'D':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (c == 'P')
{
if (!gfc_notify_std (GFC_STD_F2003, "DP format "
"specifier not allowed at %C"))
return FMT_ERROR;
token = FMT_DT;
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
if (c == '\'' || c == '"')
{
delim = c;
break;
case 'R':
- c = next_char_not_space (&error);
+ c = next_char_not_space ();
switch (c)
{
case 'C':
break;
}
- if (error)
- return FMT_ERROR;
-
return token;
}
! { dg-do compile }
-! { dg-options -Wno-error=tabs }
+! { dg-options -Wtabs }
! PR fortran/32987
+! PR fortran/58001
program TestFormat
write (*, 10)
- 10 format ('Hello ', 'bug!') ! { dg-warning "Extension: Tab character in format" }
+ ! There is a tab character before 'bug!'. This is accepted without
+ ! the -Wno-tabs option or a -std= option.
+ 10 format ('Hello ', 'bug!') ! { dg-warning "tab character in format" }
+
end
+! { dg-excess-errors "tab character in format" }