Docs Tutorial Example cppcheck

Hi all,

When going through the demo outlined in the docs, when you download the results from cppcheck there are quite a few items listed. Most of it looks like it is warnings for functions that are never used, but there are some other things sprinkled in there. I was curious if this is expected? Admittedly I am not very familiar with cppcheck so this may be pretty standard, but my initial expectation is that there would not be anything in that file aside from maybe a “check completed/all clear” type message. If the “methods not used” warnings are just because the user is expected to use those methods and the warning makes sense/is valid, is there any way to hide that kind of output from cppcheck? Would we even want to do so? Just curious.

Thanks!

Kyle

1 Like

Great Observation! I believe that the source code you are analyzing is a library. There is no “main” in a library as it is a set of functions to be used by another program. As such each function in the library’s interface will not be called without the program utilizing the library calling them, these types of warnings are expected from running cppcheck on a library. I think the best thing we could do is leave those warnings, but perhaps provide some context around why they are there.

2 Likes

Hey Andrew! Understood it makes perfect sense that, being a library, there are unused functions. Maybe if it is expected that the end user understands this, it is a moot point. But I agree it might be helpful to provide some context or heads up to the user as to why there might be items in the results from a code scan.

2 Likes

@john.macauley it looks like the Workflow bug re: the example in the tutorials you mentioned got squashed this last sprint. Thanks!

1 Like