[Patch, Fortran] PR34899 - Support <tab><digit> as continuation line marker (fixed form)
Tobias Burnus
burnus@net-b.de
Tue Jan 22 11:06:00 GMT 2008
In standard fixed-form Fortran source code, a "normal" line begins with
6 spaces and a continuation line with 5 spaces plus some character such
as '*' (there are some restrictions, see F95/F2003 standard).
A very common vendor extension is to support <tab> as replacement for 6
spaces, which also gfortran supports. However, how to create then a
continuation line? Well, for g77, NAG f95, ifort, openf95, sunf95,
pathscale, pgf95, Absoft the answer is: <tab><digit> where digit is not
zero.
The attached patch now does the following: It replaces '\t' by 6 spaces
(before it was 7) and if the the tab is followed by a non-zero digit, it
places it at position 6.
Build and regression tested on x86-64-linux.
OK for the trunk?
Tobias
PS: The patch was motivated to get to build
http://www.chara.gsu.edu/~gudehus/fits_library_package.html. However,
due to other problems it still won't build. gfortran stops first for
integer_var = .true. (unless -std=legacy) and then for "real_var = ' '".
Replacing them by transfer it stops at the same line as ifort.
PPS: There are dozens of possibilities with <tab><digit>, which are
differently treated with the different compilers, e.g. " <tab><digit>"
or "<tab> <digit>", where different compilers produce different results.
With this patch " <tab><digit>" is supported while "<tab> <digit>" is
rejected. The latter is in line with ifort but a regression with regards
to g77, which I believe we can ignore.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tab.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080122/b0a8915b/attachment.ksh>
More information about the Fortran
mailing list