warn

Specifies diagnostic messages to be issued by the compiler.

IDE Equivalent

Windows:
General > Compile Time Diagnostics
(/warn:all, /warn:none)
Compilation Diagnostics > Treat Warnings as Errors
(/warn:[no]errors)
Compilation Diagnostics > Treat Fortran Standard Warnings as Errors
(/warn:[no]stderrors)
Compilation Diagnostics > Compile Time Diagnostics
(/warn:all, /warn:none)
Compilation Diagnostics > Warn for Undeclared Symbols
(/warn:[no]declarations)
Compilation Diagnostics > Warn for Unused Variables
(/warn:[no]unused)
Compilation Diagnostics > Warn When Removing %LOC
(/warn:[no]ignore_loc)
Compilation Diagnostics > Warn When Truncating Source Line
(/warn:[no]truncated_source)
Compilation Diagnostics > Warn for Unaligned Data
(/warn:[no]alignments)
Compilation Diagnostics > Warn for Uncalled Routine
(/warn:[no]uncalled)
Compilation Diagnostics > Suppress Usage Messages
(/warn:[no]usage)
Compilation Diagnostics > Check Routine Interfaces
(/warn:[no]interfaces)
Linux: None
Mac OS:

General > Compile Time Diagnostics
(-warn all, -warn none)
Compiler Diagnostics > Warn For Unaligned Data
(-warn [no]alignments)
Compiler Diagnostics > Warn For Undeclared Symbols
(-warn [no]declarations)
Compiler Diagnostics > Treat Warnings as Errors
(-warn error)
Compiler Diagnostics > Warn When Removing %LOC
(-warn [no]ignore_loc)
Compiler Diagnostics > Check Routine Interfaces
(-warn [no]interfaces)
Compiler Diagnostics > Treat Fortran Standard Warnings As Errors
(-warn [no]stderrors)
Compiler Diagnostics > Warn When Truncating Source Line
(-warn [no]truncated_source)
Compiler Diagnostics > Warn For Uncalled Routine
(-warn [no]uncalled)
Compiler Diagnostics > Warn For Unused Variables
(-warn [no]unused)
Compiler Diagnostics > Suppress Usage Messages
(-warn [no]usage)

Architectures

IA-32 architecture, Intel® 64 architecture, IA-64 architecture

Syntax

Linux and Mac OS: -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.

The compiler generates 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 (-I) 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 std03 option (Fortran 2003 standard). If you want Fortran 95 standards violations to become errors, you must specify options warn stderrors and std95.
warn truncated_source Enables warnings when a source line exceeds the maximum column 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 and Mac OS: -nowarn, -w, -W0, -warn nogeneral
Windows: /nowarn,/w, /W0, /warn:nogeneral
warn declarations  Linux and Mac OS: -implicitnone, -u
Windows: /4Yd
warn nodeclarations Linux and Mac OS: None
Windows: /4Nd
warn general Linux and Mac OS: -W1
Windows: /W1
warn nogeneral Linux and Mac OS: -W0, -w, -nowarn, -warn none
Windows: /W0, /w, /nowarn, /warn:none
warn stderrors Linux and Mac OS: -e90, -e95, -e03
Windows: /4Ys
warn nostderrors Linux and Mac OS: None
Windows: /4Ns
warn nousage Linux and Mac OS: -cm
Windows: /cm
warn all Linux and Mac OS: -warn
Windows: /warn