How to use cppcheck’s inline suppression filter option for C++ code?

You can change the output template to display the error id from the command line, which is quite neat.

For a Visual Studio format output with error id displayed, add this to your command line:

--template "{file}({line}): {severity} ({id}): {message}"

This will produce output something like this:

s:\src\jpeg.cpp(123): error (bufferAccessOutOfBounds): Buffer access out-of-bounds: abRY

Which you can then suppress by adding the line:

// cppcheck-suppress bufferAccessOutOfBounds

To the previous line in the source file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)