Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

cppcheck is not run for header files #907

Closed
osrf-migration opened this issue Oct 21, 2013 · 5 comments
Closed

cppcheck is not run for header files #907

osrf-migration opened this issue Oct 21, 2013 · 5 comments
Labels
all bug Something isn't working major

Comments

@osrf-migration
Copy link

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Currently our code check script only runs cppcheck for files with extension .cc, but we have a number of inline and template function implementations given in header files (mostly .hh). These files should be checked as well.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


It is easy enough to enable checks for header files (1441bed in branch issue_907), but it generates a few false positives. Most of these are warnings that are easy to suppress (a14785b), but there is a false positive error from ServerFixtures.hh, that cannot be suppressed:

[test/ServerFixture.hh:1346]: (error) Null pointer dereference

This is caused by cppcheck not being able to detect the language type based on the file extension (see cppcheck bug 4323). A workaround for this is to supply a --language=c++ command-line argument. This workaround requires cppcheck 1.57 and won't work on quantal (1.55) or earlier.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


pull request #782

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


  • changed state from "new" to "resolved"

pull request #782

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • set version to "all"

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "resolved" to "closed"

@osrf-migration osrf-migration added major bug Something isn't working all labels Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
all bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

1 participant