Bug 46465 - fortran code does not get properly translated from foo.F to foo.f
Summary: fortran code does not get properly translated from foo.F to foo.f
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cpp
Version: 7.1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2001-06-28 21:53 UTC by Marize Pommot-Maia
Modified: 2008-05-01 15:38 UTC (History)
0 users

Clone Of:
Last Closed: 2001-06-28 21:53:58 UTC

Attachments (Terms of Use)

Description Marize Pommot-Maia 2001-06-28 21:53:55 UTC
Description of Problem:
There are two problems to report here:

1) When writing the foo.f originated from foo.F, by means of cpp, the
format of the foo.f file gets corrupted since the rigid structure of text
in FORTRAN is not kept in the translation.  

2) Option fixed-lline-ength-132 is reported as unknown.

How Reproducible:
It ALWAYS happen

Steps to Reproduce:
1. All is done by means of a Makefile that identifies the platform and
compilers.  Based on that information it will take the steps needed to
compile and link

Actual Results:
Cannot compile because of bad formatting of FORTRAN code.  Not even by
forcing the size of the tab.

Expected Results:
It should have created the libraries and the executable.  I must add that
it works flawlessly in RH6.2 with gcc2.91.66, gcc2.95.2

Additional Information:
The report is typically as shown below:

/lib/cpp -ftabstop=8 -DX11_exists -I/usr/X11R6/include -P alias.F alias.f
f77 -v -c -O -ffixed-line-length-132  alias.f
g77 version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (from FSF-g77 version
0.5.26 20000731 (Red Hat Linux 7.1 2.96-85))
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/f771 alias.f -quiet -dumpbase
alias.f -O -version -ffixed-line-length-132 -o /tmp/ccPtMZtz.s
f771: warning: unknown register name: line-length-132
GNU F77 version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
(i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux
7.1 2.96-85).
alias.f: In subroutine `alias':
Non-numeric character at (^) in label field [info -f g77 M LEX]
1    2
Label at (1) invalid with continuation line indicator at (2) [info -f g77 M

Comment 1 Jakub Jelinek 2001-07-23 15:08:24 UTC
You need to use cpp -traditional to preprocess Fortran source.
cpp is C Preprocessor, not Fortran preprocessor and is allowed to do with
whitespace with some exceptions all it wants.
As for -ffixed-line-length-132, see

Note You need to log in before you can comment on or make changes to this bug.