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/31765] New: gfortran gcc_gobble_whitespace broke previously working source


A (fixed form .f) source file that successfully compiled under g77 did not work
properly in gfortran. I think the gcc_gobble_whitespace() function is the
source.

One line of the source file contained a tab character in column 1, then 3 space
characters (ASCII 32), followed by 64 meaningful source characters. I don't
know how g77 handles the tab in column 1, but g77 must have replaced the tab
with LESS THAN 6 spaces.

The individual who wrote the original source code must have had an editor that
expanded tabs to 5 characters, as this person added 3 more spaces after the tab
to "format" the source nicely.  The original "5 character tab" plus the 3 extra
spaces made the line EXACTLY 72 characters in length (in his editor).

I found some reference to gcc_gobble_whitespace() on this web page:
  http://gcc.gnu.org/ml/fortran/2005-11/txt00037.txt
This "diff" suggests that, in fixed form source mode, gcc_gobble_whitespace()
expands tabs such that the "next character" is in the source region.  This must
have placed the first (of the 3) space characters in column 7 (not 6), making
the line 73 characters in length (rather than 72).

Instead of gcc_gobble_whitespace() doing this:
  expands tabs such that the "next character" is in the source region

Perhaps it should do this:
 expands tabs such that the "next NON WHITESPACE character" is in the source
region

Comments are welcome.

--------------------------------------------------------
Here is the build/version info:
GNU Fortran 95 (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)


-- 
           Summary: gfortran gcc_gobble_whitespace broke previously working
                    source
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: RenzulME at utrc dot utc dot com


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


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