LabWindows/CVI User Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI Tip: Set Custom Compiler Warning Levels

Sort Through Warnings Easier with Better Build Reporting in LabWindows/CVI 2013

The new LabWindows/CVI 2013 compiler is based on the Clang/LLVM compiler, which offers excellent error and warning reporting. The new compiler surfaces a more thorough error and warning report and uses clearer wording to describe issues. Not only will you find better quality of information available in the build output window, you can also show or hide warnings based on a customized list of warning level types. This makes it easier to find warnings of interest, focus on errors, and debug more effectively. 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.

New Features in LabWindows/CVI 2013:

  • Expanded error and warning reporting with improved readability for warning messages
  • Granular control in reporting specific warning types
  • Save custom warning level configurations to the project
  • Hide or enable specific warning types with a Right-click menu directly in the Build Output window

1. Select a Predefined Warning Level

You can set a pre-defined warning level in the Options»Build Options dialog box. Refer to the LabWindows/CVI 2013 Help on Compiler Warnings to see a table of all the warning names, the compiler warning flags, associated level and description. The same information is available in the Compiler Warnings dialog box described below, except for the compiler warning flag, which is only available in the help. Once set, the compiler warning levels are saved as part of your LabWindows/CVI project configuration.

Compiler_Warnings CVI 2013.png

Fig 1. Compiler Warnings Dialog box, to access this window, see instructions below.

2. Customize the Predefined Warning Levels

For each warning level, you have the option to add or remove warning types and restore to default settings in the Compiler Warnings dialog box. 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. There are two ways to access the Compiler Warnings dialog box in LabWindows/CVI 2013:

  1. Right-click in the Build Output window and select Configure Warnings.
  2. From the toolbar go to Options»Build Options and click on the [...] button

Compiler_Warnings_from_Build_Options.png

Fig 2. Build Options dialog box accessed from Options menu item in toolbar.

3. Hide or Enable Specific Warnings On the Fly

The Right-click menu in the LabWindows/CVI 2013 Build Output window provides a convenient way to reduce clutter and help you find the errors and warnings that you care about by removing those that you don't. When you disable a particular compiler warning in the Build Output window, all warnings of the same type will turn gray immediately and then disappear completely for subsequent compilations. You can then use the Compiler Warnings dialog box to re-enable that warning.

Compiler_Warnings_Output_Window.png

Fig 3. Right-click on a warning in the Build Output window to disable a specfic warning for future compilations.

Did you find this tip useful? Rate this document or add a comment below.

If you give this a try, share your experience! Add a comment below.

National Instruments
Contributors