The -fpedantic command-line option specifies that g77
is to warn about code that is not standard-conforming.
This is useful for finding
some extensions g77 accepts that other compilers might not accept.
(Note that the -pedantic and -pedantic-errors options
always imply -fpedantic.)
With -fno-f90 in force, ANSI FORTRAN 77 is used as the standard
for conforming code.
With -ff90 in force, Fortran 90 is used.
The constructs for which g77 issues diagnostics when -fpedantic
and -fno-f90 are in force are:
SUBROUTINE X(N)
REAL A(N)
...
where A is not listed in any ENTRY statement,
and thus is not a dummy argument.
READ (5), I and WRITE (10), J.
These commas are disallowed by FORTRAN 77, but, while strictly
superfluous, are syntactically elegant,
especially given that commas are required in statements such
as READ 99, I and PRINT *, J.
Many compilers permit the superfluous commas for this reason.
DOUBLE COMPLEX, either explicitly or implicitly.
An explicit use of this type is via a DOUBLE COMPLEX or
IMPLICIT DOUBLE COMPLEX statement, for examples.
An example of an implicit use is the expression C*D,
where C is COMPLEX(KIND=1)
and D is DOUBLE PRECISION.
This expression is prohibited by ANSI FORTRAN 77
because the rules of promotion would suggest that it
produce a DOUBLE COMPLEX result--a type not
provided for by that standard.
INTEGER(KIND=1) in contexts such as:
GOTO.
FORMAT run-time expressions (not yet supported).
READ (UNIT=3.2), I)
CHARACTER entities in specification statements.
DO
constructs in DATA statements.
LOGICAL expressions to INTEGER
in contexts such as arithmetic IF (where COMPLEX
expressions are disallowed anyway).
INTEGER I(10,20,4:2)
CHARACTER entities, as in:
PRINT *, ''
PRINT *, 'hello'(3:5)
PRINT *, FOO(,3)
COMMON
area is SAVEd (for targets where program units in a single source
file are "glued" together as they typically are for UNIX development
environments).
COMMON block.
DATA statement.
(In the GNU Fortran language, DATA I/1/ may be followed by INTEGER J,
but not INTEGER I.
The -fpedantic option disallows both of these.)
CALL FOO; CALL BAR
& in column 1 of fixed-form source (to indicate continuation).
CHARACTER constants to initialize numeric entities, and vice
versa.
X*-Y.
If -fpedantic is specified along with -ff90, the
following constructs result in diagnostics:
INCLUDE directive.