migrating code from f77 to f90

Janne Blomqvist jblomqvi@cc.hut.fi
Wed Mar 22 17:25:00 GMT 2006


On Wed, Mar 22, 2006 at 11:51:34AM -0500, Jack Howarth wrote:
> Tobi,
>     Thanks for the clarification. One other question. I noticed that in XL
> Fortran I can use -qlanglvl=77std to check for deviations from the ANSI
> F77 standard. The manpage for gfortran 4.0.2 (I don't have access to
> gcc 4.1 here at work) shows gnu, f95, f2003 and legacy as options for
> the -std= flag. However 'gfortran -v --help' in 4.0.2 shows the options
> as c89, c99, c9x, gnu89, gnu99, gnu9x, iso9899:1990, iso9899:199409,
> iso9899:1999 and iso9899:199x.

That's weird. My gfortran 4.0.2 shows 

  -std=f2003                  Conform to the ISO Fortran 2003 standard.
  -std=f95                    Conform to the ISO Fortran 95 standard.
  -std=gnu                    Conform nothing in particular.
  -std=legacy                 Accept extensions to support legacy code.

Just like trunk (and presumably 4.1 too). Of course, it also prints
all kinds of crap for the other frontends too, including the options
you mention above that apply to the C frontend.

As an aside, shouldn't the text for -std=gnu be "Conform to nothing in
particular"? I.e. the "to" is missing.

> Is it safe to assume that a -std= option
> for the f77 standard itself was never added to gfortran?

That is correct.

> Such a feature
> would be nice to have for use in the first stages of migrating code to
> Fortran 90 (by allowing the user to make their f77 code conform to the
> standard before they attempt to migrate to f90).

Since F95 is a superset of f77 (with a few exceptions that were
deleted for good reasons, and IIRC already mentioned in this thread so
I won't go through them here), you can use -std=f95 to ensure that the
code doesn't contain non-standardisms, even if it doesn't use any of
the new fancy F90+ features.

-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060322/00f328fa/attachment.sig>


More information about the Fortran mailing list