Table of Contents

Previous: -source


Option: style

-style=list
Provides extra-picky warnings about obsolescent or old-fashioned programming constructions. This option is helpful for efforts to follow a modern programming style. (Most of the things complained about under this option are forbidden in the F subset language.) By default, all warnings are turned off.

The list consists of keywords separated by commas or colons. There are three special keywords: all to turn on all the options, none to turn them all off, and help to print the list of all the keywords with a brief explanation of each. If list is omitted, -style is equivalent to -style=all, and -nostyle is equivalent to -style=none. The warning keywords with their meanings are as follows:

block-if:
Complain about arithmetic IF statement. Accept block IF or logical IF (which controls a single statement).
construct-name:
Complain about unnamed block constructs: IF, DO, and SELECT CASE. Note that if a construct name is present on the opening statement of a construct, then it is required to be present on all other component statements (ELSE, END IF, etc.) of the construct. In that case a missing construct name on those statements generates a syntax error regardless of this option. The purpose of this option is to warn if the construct completely lacks the optional name.
distinct-do:
Complain if two DO loops share a common terminator statement.
do-construct:
Complain if terminator of a DO loop is anything other than an END DO or CONTINUE statement. This is the requirement in order for the loop to meet the Fortran 90 definition of a do-construct.
do-enddo:
Complain if terminator of a DO loop is anything other than an END DO statement. (This option overrides the do-construct option, being even stricter.)
end-name:
Complain about the absence of the subprogram name on structured END statements.
format-stmt:
Complain about the presence of FORMAT statements. Only the FORMAT statements themselves are flagged, not the references to them in I/O lists.
goto:
Complain about the presence of unconditional, computed or assigned GOTO statements. Also complain about alternate returns (but not about labels as subprogram arguments).
labeled-stmt:
Complain about the presence of labels (numbers) on statements other than FORMAT statements. (Since FORMAT statements are arguably convenient and not readily abused, complaints about them are controlled by the separate format-stmt keyword.)
program-stmt:
Complain about the absence of a PROGRAM statement at the head of the main program.
structured-end:
Complain about the use of a plain END statement to end a subprogram, rather than a structured END statement (END PROGRAM, END SUBROUTINE, END FUNCTION, or END BLOCK DATA).

See also: -f77, -f90, -f95, -pretty, -portability.


Next: -symtab