warn

Specifies diagnostic messages to be issued by the compiler.

IDE Equivalent

Windows:
General > Compile Time Diagnostics
(/warn:all or /warn:none)
Diagnostics > Treat Warnings as Errors (
/warn:[no]errors)
Diagnostics > Treat Fortran Standard Warnings as Errors (
/warn:[no]stderrors)

Diagnostics > Compile-Time Diagnostics (/warn:all or /warn:none)
Diagnostics > Warn for Undeclared Symbols (
/warn:[no]declarations)
Diagnostics > Warn for Unused Variables (
/warn:[no]unused)
Diagnostics > Warn When Removing %LOC
(/warn:[no]ignore_loc)
Diagnostics > Warn When Truncating Source Line
(/warn:[no]truncated_source)
Diagnostics > Warn for Unaligned Data
(/warn:[no]alignments)
Diagnostics > Warn for Uncalled Routine
(/warn:[no]uncalled)
Diagnostics > Suppress Usage Messages (/warn:[no]usage)
Diagnostics > Check Routine Interface (
/warn:[no]interfaces)
Linux: None

Architectures

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture

Syntax

Linux: -warn [keyword]
-nowarn
Windows: /warn[:keyword]
/nowarn

Arguments

keyword     Specifies the diagnostic messages to be issued. Possible values are:
  none Disables all warning messages.
  [no]alignments Determines whether warnings occur for data that is not naturally aligned.

 

[no]declarations Determines whether warnings occur for any undeclared symbols.

 

[no]errors Determines whether warnings are changed to errors.

 

[no]general Determines whether warning messages and informational messages are issued by the compiler.

 

[no]ignore_loc Determines whether warnings occur when %LOC is stripped from an actual argument.

 

[no]interfaces Determines whether the compiler checks the interfaces of all SUBROUTINEs called and FUNCTIONs invoked in your compilation against an external set of interface blocks.

 

[no]stderrors

Determines whether warnings about Fortran standard violations are changed to errors.

 

[no]truncated_source Determines whether warnings occur when source exceeds the maximum column width in fixed-format files.

 

[no]uncalled Determines whether warnings occur when a statement function is never called

 

[no]unused Determines whether warnings occur for declared variables that are never used.

 

[no]usage Determines whether warnings occur for questionable programming practices.

 

all Enables all warning messages.

Default

alignments

Warnings are issued about data that is not naturally aligned.

general All information-level and warning-level messages are enabled.
usage Warnings are issued for questionable programming practices.
nodeclarations No errors are issued for undeclared symbols.
noerrors Warning-level messages are not changed to error-level messages.
noignore_loc No warnings are issued when %LOC is stripped from an argument.
nointerfaces The compiler does not check interfaces of SUBROUTINEs called and FUNCTIONs invoked in your compilation against an external set of interface blocks.

nostderrors

Warning-level messages about Fortran standards violations are not changed to error-level messages.

notruncated_source No warnings are issued when source exceeds the maximum column width in fixed-format files.
nouncalled No warnings are issued when a statement function is not called.
nounused No warnings are issued for variables that are declared but never used.

Description

This option specifies the diagnostic messages to be issued by the compiler.

Option

Description

warn none Disables all warning messages. This is the same as specifying nowarn.
warn noalignments Disables warnings about data that is not naturally aligned.
warn declarations Enables error messages about any undeclared symbols. This option makes the default data type of a variable undefined (IMPLICIT NONE) rather than using the implicit Fortran rules.
warn errors Tells the compiler to change all warning-level messages to error-level messages; this includes warnings about Fortran standards violations.
warn nogeneral Disables all informational-level and warning-level diagnostic messages.
warn ignore_loc Enables warnings when %LOC is stripped from an actual argument.
warn interfaces Tells the compiler to check the interfaces of all SUBROUTINEs called and FUNCTIONs invoked in your compilation against a set of interface blocks stored separately from the source being compiled.

It causes the compiler to generate a compile-time message if the interface used to invoke a routine does not match the interface defined in a .mod file external to the source (that is, in a .mod generated by  option gen-interfaces as opposed to a .mod file USEd in the source).  The compiler looks for these .mods in the current directory or in the directory specified by the include or module option.

warn stderrors

Tells the compiler to change all warning-level messages about Fortran standards violations to error-level messages. This option sets the std95 option (Fortran 95 standard). If you want Fortran 90 standards violations to become errors, you should specify warn stderrors and std90.

warn truncated_source Enables warnings when a source line exceeds the maximum columm width in fixed-format source files. The maximum column width for fixed-format files is 72, 80, or 132, depending on the setting of the extend_source option. The warn truncated_source option has no effect on truncation; lines that exceed the maximum column width are always truncated. This option does not apply to free-format source files.
warn uncalled Enables warnings when a statement function is never called.
warn unused Enables warnings for variables that are declared but never used.
warn nousage Disables warnings about questionable programming practices. Questionable programming practices, although allowed, often are the result of programming errors; for example: a continued character or Hollerith literal whose first part ends before the statement field and appears to end with trailing spaces. Note that the /pad_source option can prevent this error.
warn all Enables all warning messages. This is the same as specifying warn. This option does not set options warn errors or warn stderrors. To enable all the additional checking to be performed and force the severity of the diagnostic messages to be severe enough to not generate an object file, specify warn all warn errors or warn all warn stderrors.

On Windows systems: In the Property Pages, Custom means that diagnostics will be specified on an individual basis.

Alternate Options

warn none Linux: -nowarn, -w, -W0, -warn nogeneral
Windows: /nowarn,/w, /W0, /warn:nogeneral
warn declarations  Linux: -implicitnone, -u
Windows: /4Yd
warn nodeclarations Linux: None
Windows: /4Nd
warn general Linux: -W1
Windows: /W1
warn nogeneral Linux: -W0, -w, -nowarn, -warn none
Windows: /W0, /w, /nowarn, /warn:none
warn stderrors Linux: -e90, -e95
Windows: /4Ys
warn nostderrors Linux: None
Windows: /4Ns
warn nousage Linux: -cm
Windows: /cm
warn all Linux: -warn
Windows: /warn