# w, W

Specifies the level of diagnostic messages to be generated by the compiler.

## Syntax

Linux: | -w n

macOS: | -w n

Windows: | /W n

## Arguments

n | Is the level of diagnostic messages to be generated. Possible values are:
0 | Enables diagnostics for errors. Disables diagnostics for warnings.
1 | Enables diagnostics for warnings and errors.
2 | Enables diagnostics for warnings and errors. On Linux* and macOS* systems, additional warnings are enabled. On Windows* systems, this setting is equivalent to level 1 (n = 1).
3 | Enables diagnostics for remarks, warnings, and errors. Additional warnings are also enabled above level 2 (n = 2). This level is recommended for production purposes.
4 | Enables diagnostics for all level 3 (n = 3) warnings plus informational warnings and remarks, which in most cases can be safely ignored. This value is only available on Windows* systems.
5 | Enables diagnostics for all remarks, warnings, and errors. This setting produces the most diagnostic messages. This value is only available on Windows* systems.

## Default

n=1 | The compiler displays diagnostics for warnings and errors.

## Description

This option specifies the level of diagnostic messages to be generated by the compiler.

On Windows systems, option /W4 is equivalent to option /Wall.

The -w n, /W n, and Wall options can override each other. The last option specified on the command line takes precedence.

## IDE Equivalent

Visual Studio: General > Warning Level

Eclipse: General > Warning Level

Xcode: General > Warning Level

## Alternate Options

None

Parent topic: Compiler Diagnostic Options

## See Also

Wall compiler option