Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 1996 10:07:24 -0700 (PDT)
From:      "Steven G. Kargl" <sgk@troutmask.apl.washington.edu>
To:        jonas@mcs.com (Lars Jonas Olsson)
Cc:        jmz@cabri.obs-besancon.fr, hackers@freebsd.org, jonas@mcs.net
Subject:   Re: Potential f77 bugs
Message-ID:  <199605291707.KAA00216@troutmask.apl.washington.edu>
In-Reply-To: <m0uOmxU-0005yQC@mars.mcs.com> from "Lars Jonas Olsson" at May 29, 96 10:14:46 am

next in thread | previous in thread | raw e-mail | index | archive | help
According to Lars Jonas Olsson:
>
> According to Jean-Marc
>> 
>> In fact it seems that none of the f2c flags are processed by f77, and
>> that they are simply passed to gcc. (I also encountered this problem
>> when I wanted to use the -ext option).
>> 
>> I am interested in a wrapper able to parse all the f2c options!
>> 
>> Jean-Marc
>
>Some f2c flags are processed. The rule is:
>(From usr/src/gnu/usr.bin/cc/cc/gcc.c)
>
>/***** ljo's Fortran rule *****/
>  {".f", "@f2c"},

[rule deleted for brevity]

>/***** End of ljo's Fortran rule *****/
>
>This means that we forward to f2c the arguments:
>-checksubscripts (renamed to -C before being sent to f2c)
>-I2
>-onetrip (This one is erronuous as it conflicts with gcc's -o)
>-honorcase (renamed to -U)
>-u
>-w
>-ANSIC (renamed to -A)
>-a
>-C++
>

Write a man page!!!!!  There is NO DOCUMENTATION on how to use
the flags YOU renamed.

>etc.
>
> When I wrote this rule I renamed some arguments, but didn't study all
>arguments in detail. I think that we probably do not need all possible
>f2c options and the ones we need could be renamed to not conflict with
>the other compiler stages. The options that we rename should probably
>be named similarly to g77's options. Or perhaps rename all conflicting
>options with a f2c_ prefix. Another option is to remove some conflciting
>options sent to cpp, cc1, and as.

The current f77 does not handle preprocessing of source with .F suffixes.
The common practice on many (most) UNIX(-like) OS's is to preprocess .F files.
Thus,

f77 file.f translates to the sequence f2c-->cpp-->cc1-->as-->ld.
f77 file.F translates to the sequence cpp-->f2c-->cpp-->cc1-->as-->ld.

>If we can get a consensus on what options a Fortran compiler needs
>I think the current solution is quite flexible and solves the f2c
>integration quite well. Before this solution we had various f77
>shell scripts that never quite handled debugging, profiling, output
>renaming, etc.
>

Two other reasons exists for removing the current f77 and f2c integration
into gcc.

(1)  The wrapper I'm writing is not GPL'd.  Thus, we can remove some 
     (partially malfunctioning) GPL encumbered code from the source tree.

(2)  The f2c integration into gcc may hamper the upgrading to a higher
     version of gcc.  It may also limit the ability to test g77 with 
     FreeBSD.  Note: g77 was designed to co-exist with gcc.

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605291707.KAA00216>