Klocwork Custom Checkers

Emenda's Custom Klocwork Checkers are designed to be used with the Klocwork static analysis suite, to provide identification of additional code defects.

 

Magic Number Checker

In many safety standards, the direct use of non-zero numeric literals is forbidden. This can include variable assignments, array indexers and operands in conditional statements. In the case of C/C++ it is considered good practice to use either preprocessor defines or use constant variables. This is to ensure that any changes made to a commonly used value are automatically updated instead of having to be manually changed, where there is a high risk that an occurance could be overlooked. The Magic Number Checker flags any direct use of a non-zero (or non-boolean) numeric literal.

 

Klocwork Magic Number Custom Checker animation

Klocwork Custom Checker Information

Further information about writing and deploying Klocwork Custom Checkers can be found at the Klocwork Developer Network.

 

Download

To download the plugin please fill out all fields in the form below. You will then be emailed a link in order to download the file. If you are unable to download the resource, please contact the webmaster.

 

Multiple resources can be selected using Ctrl

emenda [emend'a]
tr.v [latin]
1. to improve, raise standards
2. to make free from errors
3. to raise level of quality