#pragma info

Description

The #pragma info directive instructs the compiler to produce or suppress specific groups of compiler messages.

Syntax

Read syntax diagramSkip visual syntax diagram>>-#--pragma--info--(--+-all-------+--)------------------------><
                       +-none------+
                       +-restore---+
                       | .-,-----. |
                       | V       | |
                       '---group-+-'

where:

all Turns on all diagnostic checking.
none Turns off all diagnostic suboptions for specific portions of your program.
restore Restores the option that was in effect before the previous #pragma info directive.
group Generates or suppresses all messages associated with the specified diagnostic group. More than one group name in the following list can be specified.
group
Type of messages returned or suppressed
c99|noc99
C code that may behave differently between C89 and C99 language levels.
cls|nocls
C++ classes.
cmp|nocmp
Possible redundancies in unsigned comparisons.
cnd|nocnd
Possible redundancies or problems in conditional expressions.
cns|nocns
Operations involving constants.
cnv|nocnv
Conversions.
dcl|nodcl
Consistency of declarations.
eff|noeff
Statements and pragmas with no effect.
enu|noenu
Consistency of enum variables.
ext|noext
Unused external definitions.
gen|nogen
General diagnostic messages.
gnr|nognr
Generation of temporary variables.
got|nogot
Use of goto statements.
ini|noini
Possible problems with initialization.
inl|noinl
Functions not inlined.
lan|nolan
Language level effects.
obs|noobs
Obsolete features.
ord|noord
Unspecified order of evaluation.
par|nopar
Unused parameters.
por|nopor
Nonportable language constructs.
ppc|noppc
Possible problems with using the preprocessor.
ppt|noppt
Trace of preprocessor actions.
pro|nopro
Missing function prototypes.
rea|norea
Code that cannot be reached.
ret|noret
Consistency of return statements.
trd|notrd
Possible truncation or loss of data or precision.
tru|notru
Variable names truncated by the compiler.
trx|notrx
Hexadecimal floating point constants rounding.
uni|nouni
Uninitialized variables.
upg|noupg
Generates messages describing new behaviors of the current compiler release as compared to the previous release.
use|nouse
Unused auto and static variables.
vft|novft
Generation of virtual function tables in C++ programs.
zea|nozea
Zero-extent arrays.

Notes

You can use the #pragma info directive to temporarily override the current -qinfo compiler option settings specified on the command line, in the configuration file, or by earlier invocations of the #pragma info directive.

Example

For example, in the code segments below, the #pragma info(eff, nouni) directive preceding MyFunction1 instructs the compiler to generate messages identifying statements or pragmas with no effect, and to suppress messages identifying uninitialized variables. The #pragma info(restore) directive preceding MyFunction2 instructs the compiler to restore the message options that were in effect before the #pragma info(eff, nouni) directive was invoked.

#pragma info(eff, nouni) 
int MyFunction1()
{
  .
  .
  .

}

#pragma info(restore)
int MyFunction2()
{
  .
  .
  .

}

Related information