Admin Production ni-theme
Current Publication

Compiler Warnings Dialog Box

LabWindows/CVI

Compiler Warnings Dialog Box

Use the Compiler Warnings dialog box to customize the warnings LabWindows/CVI displays in the Build Output window. You can select a predefined warning level that contains a group of specific warnings or you can use the checkboxes to select individual warnings manually.

The Compiler Warnings dialog box contains the following options:

  • Warning level—Sets the warning level for the compiler warnings that appear in the Build Output window. Select from the following warning levels:
    • None—Displays no warnings.
    • Common—Displays the warnings labeled as Common.
    • Extended—Displays the warnings labeled as Common and Extended.
    • All—Displays the warnings labeled as Common, Extended, and All.
    You can reset the warning levels to the default state for the project by clicking the Restore to default button.

    When you add or remove warnings from a warning level, LabWindows/CVI places an asterisk (*) next to the warning level label to indicate this modification.

    If you open a project saved in LabWindows/CVI 2012 or earlier, LabWindows/CVI automatically selects the warnings for the project that correspond to the LabWindows/CVI 2012 and earlier settings.
  • Warning selection table—Displays the warnings, the default level with which the warning is associated, and whether the individual warning has been added to a different warning level or removed from its default warning level. You can right-click in the selection table and select from the following context menu options:
    • Find—Invokes the Find dialog box.
    • Show warning flags/Show warning names—Toggles between displaying the warning flags the compiler uses or displaying the easy-to-read warning names.
    • Sort by level—Sorts the warnings according to the level with which they are associated.
    • Sort by status—Sorts the warnings according to their status of Added or Removed.
    • Sort by state—Sorts the warnings by their state of selected or unselected.
    • Sort alphabetically—Sorts the warnings alphabetically.
    Refer to the table below for more information about the compiler warnings.
  • Warning description—Displays a description of the warning type.
  • Code example—Displays example code that demonstrates the warning.

The following table displays the warning name, warning flag, associated warning level, and description for the warnings you can choose to display or hide in the Build Output window.

Warning NameWarning FlagWarning LevelWarning Description
Array bounds-Warray-boundsCommonWarn if an array is accessed out of bounds.
Assign enum-Wassign-enumCommonWarn if an enum variable is assigned a value that is not covered by the enum.
Char initialization-Wchar-initCommonWarn if an improper char array initialization is detected.
Covered switch default-Wcovered-switch-defaultCommonWarn if a switch that covers all values of an enum has a default case.
Disabled macro expansion-Wdisabled-macro-expansionCommonWarn about recursive macros, for which expansion is disabled.
Division by zero-Wdivision-by-zeroCommonWarn if division by zero is detected.
Duplicate declaration specifier-Wduplicate-decl-specifierCommonWarn if a declaration contains a duplicate type specifier.
Ignored qualifiers-Wignored-qualifiersCommonWarn if the type qualifier of a return type is ignored.
Integer precision loss-Wint-conversionCommonWarn about precision loss in conversions involving integer numbers. This warning is especially useful for porting code to 64-bit.
Invalid return-Winvalid-returnCommonWarn when return statements return values for void functions. This warning turns into an error when C99 extensions are enabled.
Invalid source encoding-Winvalid-source-encodingCommonWarn about illegal character encoding in character or string literals.
KnR promoted parameter compatibility-Wknr-promoted-parameterCommonWarn if a promoted old-style function parameter is not compatible with the parameter type of the previous function declaration.
Loop analysis-Wloop-analysisCommonWarn if variable(s) used in loop condition are not modified in loop body.
Missing return value-Wmissing-return-valueCommonWarn when the return statement is missing the value for non-void functions.
Null dereference-Wnull-dereferenceCommonWarn if a null pointer is dereferenced.
OpenMP: nested parallel-Womp-nested-parallelCommonWarn if a nested parallel construct is ignored. OpenMP support and C99 extensions must be enabled to receive this warning.
OpenMP: repeated ordered-Womp-repeated-orderedCommonWarn if multiple ordered regions are detected in a loop iteration. OpenMP support and C99 extensions must be enabled to receive this warning.
Panel handle-Wpanel-handleCommonWarn if a constant expression is used as a panel handle.
Parentheses-WparenthesesCommonWarn if operators are mixed in a way that suggests that a problem can occur due to operator precendence, which can be resolved by the use of parentheses.
Pointer conversions-Wpointer-convCommonDetect incompatible conversions involving pointers.
Pointer sign-Wpointer-signCommonWarn if a signed/unsigned pointer mismatch is detected.
Pointer to int conversions-Wpointer-int-convCommonDetect incompatible conversions involving pointers and integers.
Return type-Wreturn-typeCommonWarn if a non-void function does not have a return type.
Sequence point-Wsequence-pointCommonWarn about a sequencing ambiguity within an expression.
Sizeof array argument-Wsizeof-array-argumentCommonWarn about possible unintended usage of sizeof applied to an array function parameter.
Sizeof array decay-Wsizeof-array-decayCommonWarn about possible unintended usage of sizeof applied to pointer arithmetic on an array variable.
strncat size-Wstrncat-sizeCommonWarn about wrong values passed to size argument of strncat function.
Uninitialized locals-WuninitializedCommonWarn if an uninitialized local variable is detected.
Unreachable code-Wunreachable-codeCommonWarn if unreachable code is detected.
Unused variable-Wunused-variableCommonWarn if an unreferenced identifier is detected.
Array bounds pointer arithmetic-Warray-bounds-pointer-arithmeticExtendedWarn about pointer operation reaching out of array bounds.
Bad function cast-Wbad-function-castExtendedWarn about casting a function call to a non-matching type.
C99 extensions-Wc99-extensionsExtendedWarn about C99 extensions.
Cast align-Wcast-alignExtendedWarn if a pointer cast increases alignment.
Char subscripts-Wchar-subscriptsExtendedWarn if an array subscript has type char.
Dangling else-Wdangling-elseExtendedWarn about possible unintended matching of an else.
Declaration after statement-Wdeclaration-after-statementExtendedWarn if a declaration is found after a statement in a block, which is not supported in ISO 90. This warning is not displayed when C99 extensions are enabled.
Duplicate enum-Wduplicate-enumExtendedWarn if an enum has duplicate values.
Empty body-Wempty-bodyExtendedWarn if a for, if, or while statement contains an empty body.
Float comparisons-Wfloat-equalExtendedWarn if floating-point numbers are compared using == or !=.
Integer overflow-Winteger-overflowExtendedWarn if an overflow occurs in an arithmetic expression.
Integer to pointer cast-Wint-to-pointer-castExtendedWarn about casting from a smaller integer type to a pointer type.
Invalid noreturn-Winvalid-noreturnExtendedWarn if a function specifies the noreturn attribute but does return.
Invalid token pasting-Winvalid-token-pasteExtendedWarn if an invalid preprocessing token was encountered while applying the token pasting operator.
Missing braces-Wmissing-bracesExtendedWarn if an aggregate or union initializer is bracketed incompletely.
Missing noreturn-Wmissing-noreturnExtendedWarn if a function that might be a candidate for the noreturn attribute is detected.
Overlength strings-Woverlength-stringsExtendedWarn if a string constant is longer than what the C standard requires compilers to handle.
Precision loss-WconversionExtendedWarn if implicit conversions might result in the loss of precision.
Shadow-WshadowExtendedWarn if a local variable shadows another existing local variable, parameter, or global variable.
Sign compare-Wsign-compareExtendedWarn if a comparison between signed and unsigned values might produce an incorrect result when the signed value is converted to unsigned.
Strict function prototypes-Wstrict-prototypesExtendedWarn for old-style function declarations or definitions.
Switch-WswitchExtendedWarn if an enumerated value does not have a case in the switch statement. If a default case exists, this warning is not displayed.
Switch enum-Wswitch-enumExtendedWarn if an enumerated value does not have a case in the switch statement. If a default case exists, this warning is still displayed.
Tautological compare-Wtautological-compareExtendedWarn if fixed-result comparisons are detected.
Typecheck convert-Wtypecheck-convertExtendedDetect type mismatch.
Unused function-Wunused-functionExtendedWarn if a static function is declared but is not defined. Also warns if a non-inline static function is unused.
Unused label-Wunused-labelExtendedWarn if a label is unused.
Unused value-Wunused-valueExtendedWarn if an expression value is unused.
Used but marked unused-Wused-but-marked-unusedExtendedWarn if a parameter marked as unused is in fact used in the function.
Variable named argument-Wva-named-paramExtendedWarn if the second parameter of 'va_start' is not the last named argument.
Backslash newline escape-Wbackslash-newline-escapeAllWarn if backslash and newline are separated by space.
Built-in macro redefined-Wbuiltin-macro-redefinedAllWarn if built-in macros, such as __TIME__, are redefined on the command line or by directives.
Built-in macro undefined-Wbuiltin-macro-undefinedAllWarn if built-in macros, such as __TIME__, are undefined on the command line or by directives.
Built-in requires header-Wbuiltin-requires-headerAllWarn about a built-in function requiring a header.
Clang-specific extensions-WclangAllWarn if extensions specific to the Clang compiler are detected. Examples: casting to union types, forward references to enum types, zero-length arrays, and other similar situations.
Comment-WcommentAllWarn if a comment start sequence /* appears within a /* */ comment, or if a backslash-newline appears within a // comment.
Constant conversion-Wconstant-conversionAllWarn about implicit value-altering conversions of constants.
Constant logical operand-Wconstant-logical-operandAllWarn if a logical operator is used instead of a bitwise operator.
Constant too large-Wconstant-too-largeAllWarn if an integer constant is too large for its type.
Visibility-WvisibilityAllWarn about visibility of redefinitions/declarations in function parameter list.
Deprecated declaration-Wdeprecated-declarationsAllWarn if an __attribute__((deprecated)) declaration is used.
Discard qualifiers-Wdiscard-qualAllWarn if a qualification is discarded in a situation such as initialization, assignment, or passing an argument.
End of directive-Wend-of-directiveAllWarn if the end of the directive is missing in a pragma declaration.
Enum value too large-Wmicrosoft-enum-valueAllWarn if an enum value is not representable in the underlying type.
Excess elements-Wexcess-elementsAllWarn if excess elements are in a construct.
Expected semicolon-Wexpected-semiAllWarn if a semicolon (;) is missing at the end of a declaration list.
Extern variables initialized-Wextern-initializerAllWarn if an extern variable is initialized.
Extra tokens-Wextra-tokensAllWarn if there is an extra token in a directive.
Format-WformatAllWarn if the arguments supplied to printf, scanf, and similar functions are not the appropriate type for the format string specified. Also warns if any conversion specified in the format string is not valid.
Four char constants-Wfour-char-constantsAllWarn if a four-character constant is detected.
GNU binary literal-Wgnu-binary-literalAllWarn about binary literals being a GNU extension.
GNU complex integer -Wgnu-complex-integerAllWarn about a complex integer being a GNU extension.
GNU compound literal initializer-Wgnu-compound-literal-initializerAllWarn that initialization of objects with static storage duration by compound literals is a GNU extension.
GNU designator-Wgnu-designatorAllWarn if a GNU old-style field designator extension is used.
GNU folding constant-Wgnu-folding-constantAllWarn about variable length arrays being folded to constant arrays as a GNU extension. This warning is not displayed when C99 extensions are enabled.
GNU imaginary constant-Wgnu-imaginary-constantAllWarn about an imaginary constant being a GNU extension.
Ignored Attributes-Wignored-attributesAllWarn about invalid or inconsistent attribute usage.
Ignored pragmas-Wignored-pragmasAllWarn if a pragma option is ignored.
Illegal storage-Willegal-storageAllWarn about illegal storage class on functions.
Implicit function declarations-Wimplicit-function-declarationAllWarn if a function is used before it is declared. This warning is not displayed when C99 extensions are enabled.
Implicit int-Wimplicit-intAllWarn if a declaration does not include a type.
Include next-Winclude-nextAllWarn if a #include_next directive is in the primary source file.
Incomplete fields-Wincomplete-fieldAllIncomplete fields may be used only at the end of a struct.
Initialization braces-Wbraces-initAllWarn if initializer braces are used improperly.
Initializer overrides-Winitializer-overridesAllWarn if subobject initialization overrides the initialization of other fields or if initializer overrides prior initialization of this subobject.
Invalid preprocessing token-Winvalid-pp-tokenAllWarn about an invalid preprocessing token.
Line number-Wline-numberAllWarn if the #line directive is provided with a non-decimal number.
Literal range-Wliteral-rangeAllWarn if a constant is too large for the type.
Long long-Wlong-longAllWarn if the long long type is used. This warning is not displayed when C99 extensions are enabled.
Macro name-Wmacro-nameAllWarn if whitespaces are missing after the macro name.
Macro poisoning-Wmacro-poisoningAllWarn if the #pragma GCC poison directive is used on an existing macro.
Macro redefined-Wmacro-redefinedAllWarn if a macro is redefined. This warning is not displayed when C99 extensions are enabled.
Member redeclare-Wmember-redeclareAllWarn if a member of a struct or union is redeclared.
Missing declarations-Wmissing-declarationsAllWarn if a declaration is missing or it is invalid.
Missing field initializers-Wmissing-field-initializersAllWarn if the initializer of a structure is missing fields.
Missing variable declarations-Wmissing-variable-declarationsAllWarn if a global variable declaration is not preceded by an extern declaration.
Multichar-WmulticharAllWarn if a multicharacter constant is used.
Negative to unsigned conversions-Wnegative-to-unsignedAllWarn if a negative value is converted to unsigned.
Non-null-WnonnullAllWarn if a NULL pointer is passed for an argument marked by the nonnull function attribute.
Ordered comparison-Wordered-comparisonAllWarn about improper comparisons of memory addresses.
Out-of-scope declarations-Wout-of-scope-declarationsAllWarn about out-of-scope declarations.
Packed-WpackedAllWarn if the packed attribute has no effect on struct layout.
Padded-WpaddedAllWarn if padding is required to align structure members.
Pointer compare-Wpointer-compareAllWarn about comparisons involving pointers of different types.
Pound warnings-W#warningsAllDisplay warnings specified by the #warning directive.
Pragma not supported-Wpragma-not-supportedAllWarn if an unsupported pragma is encountered.
Pragma on-off switch-Wpragma-on-off-switchAllWarn if the pragma does not specify ON, OFF, or DEFAULT.
Pragma reset-Wpragma-resetAllWarn if the pragma reset option is ignored. This warning is not displayed when C99 extensions are enabled.
Pragma unused-Wpragma-unusedAllWarn if inconsistencies in #pragma unused arguments are detected.
Return stack address-Wreturn-stack-addressAllWarn if return of address/reference of stack memory is detected.
Shift-WshiftAllWarn about unsafe shift operations.
Sign conversion-Wsign-conversionAllWarn if an unsigned value is implicitly converted to a signed value.
Single-parameter main-WmainAllWarn if the main function has only one parameter.
Static/non-static declarations-Wstatic-non-staticAllWarn if a static declaration follows a non-static declaration.
Tentative strings-WtentativeAllWarn if improper uses of tentative strings are detected.
Too many arguments-Wtoo-many-argsAllWarn if a function call with too many arguments is detected.
Trigraphs-WtrigraphsAllWarn if any trigraphs that might change the meaning of the application are encountered. Warnings are not displayed for trigraphs within comments.
Undefined identifier-WundefAllWarn if an identifier, that is not a macro, is encountered in a #if directive. Undefined identifiers evaluate to zero.
Unexpected token-Wunexpected-tokenAllWarn about unexpected tokens.
Unicode-WunicodeAllWarn about universal character names.
Unknown attributes-Wunknown-attributesAllWarn about unknown attributes.
Unknown escape sequence-Wunknown-escapeAllWarn about unknown escape sequences.
Unknown pragmas-Wunknown-pragmasAllWarn if a #pragma directive is encountered that is not understood.
Unused macros-Wunused-macrosAllWarn if unused macros are detected.
Unused parameter-Wunused-parameterAllWarn if a function parameter is unused.
Variable-length array-WvlaAllWarn if a variable-length array is used when C99 extensions are disabled.
Variadic call convention-Wvariadic-call-convAllWarn if a variadic function is declared with the __stdcall calling convention in a 32-bit configuration.
Variadic macros-Wvariadic-macrosAllWarn if variadic macros are used when C99 extensions are disabled.
Weak attribute-WweakAllWarn about improper usages of constructs containing the weak attribute.