Intel® Fortran Compiler 16.0 User and Reference Guide

warn

Specifies diagnostic messages to be issued by the compiler.

Syntax

Linux and OS X:

-warn [keyword[, keyword...]]

-nowarn

Windows:

/warn[:keyword[, 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 names.

[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 except errors and stderrors.

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 warnings are issued for undeclared names.

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 warnings about any undeclared names. The compiler will use the default implicit data typing rules for such undeclared names. The IMPLICIT and IMPLICIT NONE statements override this option.

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. If interface mismatches occur, some will result in a compile-time error, others will only generate a warning.

By default, warn interfaces turns on option gen-interfaces. You can turn off that option by explicitly specifying option /gen-interfaces- (Windows* OS) or -no-gen-interfaces (Linux* OS and OS X*).

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

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.

IDE Equivalent

Visual Studio: General > Compile Time Diagnostics (/warn:all, /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, /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 Statement Function (/warn:[no]uncalled)

Diagnostics > Suppress Usage Messages (/warn:[no]usage)

Diagnostics > Check Routine Interfaces (/warn:[no]interfaces)

Eclipse: None

Xcode: General > Compile Time Diagnostics (-warn all, -warn none)

Diagnostics > Warn For Unaligned Data (-warn [no]alignments)

Diagnostics > Warn For Undeclared Symbols (-warn [no]declarations)

Diagnostics > Treat Warnings as Errors (-warn error)

Diagnostics > Warn When Removing %LOC (-warn [no]ignore_loc)

Diagnostics > Check Routine Interfaces (-warn [no]interfaces)

Diagnostics > Treat Fortran Standard Warnings As Errors (-warn [no]stderrors)

Diagnostics > Warn When Truncating Source Line (-warn [no]truncated_source)

Diagnostics > Warn For Uncalled Routine (-warn [no]uncalled)

Diagnostics > Warn For Unused Variables (-warn [no]unused)

Diagnostics > Suppress Usage Messages (-warn [no]usage)

Alternate Options

warn none

Linux and OS X: -nowarn, -w, -W0, -warn nogeneral

Windows: /nowarn,/w, /W0, /warn:nogeneral

warn declarations

Linux and OS X: -implicitnone, -u

Windows: /4Yd

warn nodeclarations

Linux and OS X: None

Windows: /4Nd

warn general

Linux and OS X: -W1

Windows: /W1

warn nogeneral

Linux and OS X: -W0, -w, -nowarn, -warn none

Windows: /W0, /w, /nowarn, /warn:none

warn stderrors

Linux and OS X: -e90, -e95, -e03

Windows: None

warn all

Linux and OS X: -warn

Windows: /warn (this is a deprecated option)