This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/39229] No warning of truncated lines if a continuation line follows



------- Comment #3 from dfranke at gcc dot gnu dot org  2009-02-23 19:38 -------
parse.c (next_statement):
816   if (gfc_at_eol ())
817     {
818       if ((gfc_option.warn_line_truncation || gfc_current_form ==
FORM_FREE)
819           && gfc_current_locus.lb
820           && gfc_current_locus.lb->truncated)
821         gfc_warning_now ("Line truncated at %C");
822
823       gfc_advance_line ();
824     }

scanner.c:
gfc_at_eol (void)
{
  if (gfc_at_eof ())
    return 1;

  return (*gfc_current_locus.nextc == '\0');
}

in gdb:

Breakpoint 1, next_statement () at
/home/daniel/svn/gcc-whole-file/gcc/fortran/parse.c:816
816           if (gfc_at_eol ())
(gdb) print *gfc_current_locus->lb
$22 = {location = 3, file = 0xa8a4930, next = 0xa8bb5f8, truncated = 1,
dbg_emitted = 0 '\0', line = {32}}
(gdb) print *gfc_current_locus->nextc
$23 = 32
(gdb) cont
Continuing.

Breakpoint 1, next_statement () at
/home/daniel/svn/gcc-whole-file/gcc/fortran/parse.c:816
816           if (gfc_at_eol ())
(gdb) print *gfc_current_locus->lb
$24 = {location = 131, file = 0xa8a4930, next = 0xa8bb738, truncated = 0,
dbg_emitted = 1 '\001', line = {32}}
(gdb) print *gfc_current_locus->nextc
$25 = 0

For the continued line gfc_at_eol() returns false and thus its truncated-flag
is silently lost.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39229


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]