Purpose
Determines which language standard (or
superset, or subset of a standard) to consult for nonconformance.
It identifies nonconforming source code and also options that allow
such nonconformances.
Syntax
.-:------------.
V .-extended-. |
>>- -q--langlvl--=----+-77std----+-+---------------------------><
+-90std----+
+-90pure---+
+-95std----+
+-95pure---+
+-2003std--+
+-2003pure-+
+-2008std--+
+-2008pure-+
+-ts-------+
'-tspure---'
@PROCESS:
@PROCESS LANGLVL({suboption})
Defaults
-qlanglvl=extended
Parameters
- 77std
- Accepts the language that the ANSI FORTRAN 77 standard specifies
and reports anything else using language-level messages.
- 90std
- Accepts the language that the ISO Fortran 90 standard specifies
and reports anything else using language-level messages.
- 90pure
- The same as 90std except that it also issues
language-level messages for any obsolescent Fortran 90 features
used.
- 90ext
- Obsolete suboption that is equivalent to extended.
- 95std
- Accepts the language that the ISO Fortran 95 standard specifies
and reports anything else using language-level messages.
- 95pure
- The same as 95std except that it also issues
language-level messages for any obsolescent Fortran 95 features
used.
- 2003std
- Accepts the language that the ISO Fortran 2003 standard
specifies and reports anything else using language-level messages.
- 2003pure
- The same as 2003std except that it also issues
language-level messages for any obsolescent Fortran 2003 features
used.
- 2008std
- Accepts the language that the ISO Fortran 2003 standard specifies
and all Fortran 2008 features supported by XL Fortran,
and reports anything else using language-level messages.
- 2008pure
- The same as 2008std except that it also
issues language-level messages for any obsolescent Fortran 2008 features
used.
- ts
- Accepts the language that a standard technical specification
specifies supplements the latest language standard. Reports anything
else using language-level messages. A Technical Specification is an
addition to the current Fortran standard. This option checks for the
language that the ISO Fortran 2003 standard specifies, all supported
ISO Fortran 2008 standard features, and all supported ISO TS 29113
features.
- tspure
- The same as ts except that it also issues
language-level messages for any obsolescent Technical Specification
features used.
- extended
- Accepts the full Fortran 2003 language standard, all
Fortran 2008 features supported by XL Fortran,
and all extensions, effectively turning off language-level checking.
Usage
When a -qlanglvl setting
is specified, the compiler issues a message with severity code L if
it detects syntax that is not allowed by the language level that you
specified.
The -qflag option can override
the -qlanglvl option.
The langlvl runtime
option, which is described in Setting runtime options,
helps to locate runtime extensions that cannot be checked for at
compile time.
Examples
The following example contains
source code that conforms to a mixture of Fortran standards:
!----------------------------------------------------------
! in free source form
program tt
integer :: a(100,100), b(100), i
real :: x, y
...
goto (10, 20, 30), i
10 continue
pause 'waiting for input'
20 continue
y= gamma(x)
30 continue
b = maxloc(a, dim=1, mask=a .lt 0)
end program
!----------------------------------------------------------
The
following
table shows examples of how some
-qlanglvl suboptions
affect this sample program:
-qlanglvl Suboption Specified |
Result |
Reason |
95pure |
Flags PAUSE statement
Flags computed GOTO
statement
Flags GAMMA intrinsic
|
Deleted feature in
Fortran 95
Obsolescent feature in
Fortran 95
Extension to Fortran 95
|
95std |
Flags PAUSE statement
Flags GAMMA intrinsic
|
Deleted feature in
Fortran 95
Extension to Fortran 95
|
extended |
No errors flagged |
|