Commit fd1935d5 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/34899 (Continuation lines with <tab><number> not recognized)

2008-01-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34899
        * scanner.c (load_line): Support <tab><digit> continuation
        * lines.
        * invoke.texi (-Wtabs): Document this.

2008-01-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34899
        * gfortran.dg/tab_continuation.f: New.

From-SVN: r131713
parent 87a64f53
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34899
* scanner.c (load_line): Support <tab><digit> continuation lines.
* invoke.texi (-Wtabs): Document this.
2008-01-22 Paul Thomas <pault@gcc.gnu.org> 2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34896 PR fortran/34896
......
...@@ -499,10 +499,11 @@ A TRANSFER specifies a source that is shorter than the destination. ...@@ -499,10 +499,11 @@ A TRANSFER specifies a source that is shorter than the destination.
@cindex warnings, tabs @cindex warnings, tabs
@cindex tabulators @cindex tabulators
By default, tabs are accepted as whitespace, but tabs are not members By default, tabs are accepted as whitespace, but tabs are not members
of the Fortran Character Set. @option{-Wno-tabs} will cause a warning of the Fortran Character Set. For continuation lines, a tab followed
to be issued if a tab is encountered. Note, @option{-Wno-tabs} is active by a digit between 1 and 9 is supported. @option{-Wno-tabs} will cause
for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003}, and a warning to be issued if a tab is encountered. Note, @option{-Wno-tabs}
@option{-Wall}. is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
and @option{-Wall}.
@item -Wunderflow @item -Wunderflow
@opindex @code{Wunderflow} @opindex @code{Wunderflow}
......
...@@ -1106,6 +1106,7 @@ load_line (FILE *input, char **pbuf, int *pbuflen) ...@@ -1106,6 +1106,7 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
int trunc_flag = 0, seen_comment = 0; int trunc_flag = 0, seen_comment = 0;
int seen_printable = 0, seen_ampersand = 0; int seen_printable = 0, seen_ampersand = 0;
char *buffer; char *buffer;
bool found_tab = false;
/* Determine the maximum allowed line length. */ /* Determine the maximum allowed line length. */
if (gfc_current_form == FORM_FREE) if (gfc_current_form == FORM_FREE)
...@@ -1184,17 +1185,30 @@ load_line (FILE *input, char **pbuf, int *pbuflen) ...@@ -1184,17 +1185,30 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
&& (c == '*' || c == 'c' || c == 'd')) && (c == '*' || c == 'c' || c == 'd'))
seen_comment = 1; seen_comment = 1;
if (gfc_current_form == FORM_FIXED && c == '\t' && i <= 6) /* Vendor extension: "<tab>1" marks a continuation line. */
if (found_tab)
{ {
found_tab = false;
if (c >= '1' && c <= '9')
{
*(buffer-1) = c;
continue;
}
}
if (gfc_current_form == FORM_FIXED && c == '\t' && i < 6)
{
found_tab = true;
if (!gfc_option.warn_tabs && seen_comment == 0 if (!gfc_option.warn_tabs && seen_comment == 0
&& current_line != linenum) && current_line != linenum)
{ {
linenum = current_line; linenum = current_line;
gfc_warning_now ("Nonconforming tab character in column 1 " gfc_warning_now ("Nonconforming tab character in column %d "
"of line %d", linenum); "of line %d", i+1, linenum);
} }
while (i <= 6) while (i < 6)
{ {
*buffer++ = ' '; *buffer++ = ' ';
i++; i++;
......
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34899
* gfortran.dg/tab_continuation.f: New.
2008-01-22 Paul Thomas <pault@gcc.gnu.org> 2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34896 PR fortran/34896
! { dg-do compile }
!
! PR fortran/34899
!
! Allow <tab>1 to <tab>9 as continuation marker, which is a very common
! vendor extension.
!
PARAMETER (LUMIN=11,LUMAX=20,MAPMAX=256,NPLANEMAX=999)
INTEGER NAXIS(0:MAPMAX,LUMIN:LUMAX),NAXIS1(0:MAPMAX,LUMIN:LUMAX),
1NAXIS2(0:MAPMAX,LUMIN:LUMAX),NAXIS3(0:MAPMAX,LUMIN:LUMAX)
end
! { dg-warning "Nonconforming tab character in column 1 of line 8" "Nonconforming tab" {target "*-*-*"} 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 9" "Nonconforming tab" {target "*-*-*"} 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 10" "Nonconforming tab" {target "*-*-*"} 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 11" "Nonconforming tab" {target "*-*-*"} 0 }
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