diag, Qdiag

Controls the display of diagnostic information.

IDE Equivalent

Windows:
Diagnostics > Disable Specific Diagnostics
(/Qdiag-disable id)
Diagnostics > Level of Static Analysis (/Qdiag-enable[:sv1, sv2, sv3])
Linux: None
Mac OS:
Diagnostics > Disable Specific Diagnostics
(-diag-disable id)
Diagnostics > Level of Static Analysis (/Qdiag-enable[:sv1, sv2, sv3])

Architectures

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

Syntax

Linux and Mac OS: -diag-type diag-list
Windows:  /Qdiag-type:diag-list

Arguments

type Is an action to perform on diagnostics. Possible values are:
  enable Enables a diagnostic message or a group of messages.
  disable Disables a diagnostic message or a group of messages.
  error Tells the compiler to change diagnostics to errors.
  warning Tells the compiler to change diagnostics to warnings.
  remark Tells the compiler to change diagnostics to remarks (comments).
diag-list Is a diagnostic group or ID value. Possible values are:
  driver Specifies diagnostic messages issued by the compiler driver.
  vec Specifies diagnostic messages issued by the vectorizer.
  par Specifies diagnostic messages issued by the auto-parallelizer (parallel optimizer).
  sv[n] Specifies diagnostic messages issued by the Static Verifier. n can be any of the following: 1, 2, 3. For more details on these values, see below.
  warn Specifies diagnostic messages that have a "warning" severity level.
  error Specifies diagnostic messages that have an "error" severity level.
  remark Specifies diagnostic messages that are remarks or comments.
  cpu-dispatch Specifies the CPU dispatch remarks for diagnostic messages. These remarks are enabled by default. This diagnostic group is only available on IA-32 architecture and Intel® 64 architecture.
  id[,id,...] Specifies the ID number of one or more messages. If you specify more than one message number, they must be separated by commas. There can be no intervening white space between each id.
  tag[,tag,...] Specifies the mnemonic name of one or more messages. If you specify more than one mnemonic name, they must be separated by commas. There can be no intervening white space between each tag.

Default

OFF The compiler issues certain diagnostic messages by default.

Description

This option controls the display of diagnostic information. Diagnostic messages are output to stderr unless compiler option -diag-file (Linux and Mac OS) or /Qdiag-file (Windows) is specified.

When diag-list value "warn" is used with the Static Verifier (sv) diagnostics, the following behavior occurs:

The following table shows more information on values you can specify for diag-list item sv.

diag-list Item Description
sv[n] The value of n for Static Verifier messages can be any of the following:
  1 Produces the diagnostics with severity level set to all critical errors.
  2 Produces the diagnostics with severity level set to all errors. This is the default if n is not specified.
  3 Produces the diagnostics with severity level set to all errors and warnings.

To control the diagnostic information reported by the vectorizer, use the -vec-report (Linux and Mac OS) or /Qvec-report (Windows) option. To control the diagnostic information reported by the auto-parallelizer, use the -par-report (Linux and Mac OS) or /Qpar-report (Windows) option.

Alternate Options

enable vec Linux and Mac OS: -vec-report
Windows: /Qvec-report
disable vec Linux and Mac OS: -vec-report0
Windows: /Qvec-report0
enable par Linux and Mac OS: -par-report
Windows: /Qpar-report
disable par Linux and Mac OS: -par-report0
Windows: /Qpar-report0

Example

The following example shows how to enable diagnostic IDs 117, 230 and 450:

-diag-enable 117,230,450     ! Linux and Mac OS systems
/Qdiag-enable:117,230,450    ! Windows systems
 

The following example shows how to change vectorizer diagnostic messages to warnings:

-diag-enable vec -diag-warning vec      ! Linux and Mac OS systems
/Qdiag-enable:vec /Qdiag-warning:vec    ! Windows systems
 

Note that you need to enable the vectorizer diagnostics before you can change them to warnings.

The following example shows how to disable all auto-parallelizer diagnostic messages:

-diag-disable par     ! Linux and Mac OS systems
/Qdiag-disable:par    ! Windows systems
 

The following example shows how to produce Static Verifier diagnostic messages for all critical errors:

-diag-enable sv1      ! Linux and Mac OS systems
/Qdiag-enable:sv1     ! Windows systems
 

The following example shows how to cause Static Verifier diagnostics (and default diagnostics) to be sent to a file:

-diag-enable sv -diag-file=stat_ver_msg     ! Linux and Mac OS systems
/Qdiag-enable:sv /Qdiag-file:stat_ver_msg   ! Windows systems
 

Note that you need to enable the Static Verifier diagnostics before you can send them to a file. In this case, the diagnostics are sent to file stat_ver_msg.diag. If a file name is not specified, the diagnostics are sent to name-of-the-first-source-file.diag.

The following example shows how to change all diagnostic warnings and remarks to errors:

-diag-error warn,remark    ! Linux and Mac OS systems
/Qdiag-error:warn,remark   ! Windows systems
 

See Also

diag-dump, Qdiag-dump compiler option

diag-id-numbers, Qdiag-id-numbers compiler option

diag-enable sv-include, Qdiag-enable:sv-include compiler option

diag-file, Qdiag-file compiler option

par-report, Qpar-report compiler option

vec-report, Qvec-report compiler option