-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cppcheck warns about unused functions (which are used!) #22
Comments
I also came across this. The command-line will not report the warning since it will scan all files in a single scan and see the usage. In the IDE it will only scan the separate file so it appear unused to it. I think it should use I will also take a look at figuring out if this warning could be made a bit smarter - some ideas:
|
I created a ticket with Cppcheck - see https://trac.cppcheck.net/ticket/9682 |
There's a similar issue with |
Yes, this is why This is causes by the |
Still Cppcheck could be smarter about this. Tickets are filed and hopefully at some point someone will care about it... (possibly me at some point :D) |
Until Cppcheck behaves better I would suggest to internally disable these warnings for headers. I already have a patch ready. |
…s for header files to avoid false positives - fixes johnthagen#22
I filed another ticket with an idea on how to improve this - see https://trac.cppcheck.net/ticket/10727. |
A fix of this bug will be very helpfull |
Environment
cppcheck --version
): Cppcheck 1.86Expected behaviour
Do not warn about functions that are called
On command line
cppcheck --enable=all --force --inconclusive --language=c++ --std=c++14 --suppress=missingIncludeSystem *.cpp
does not give any warningsActual behaviour
cppcheck: (style) The function funcFoo is never used
warning in CLion right gutter as well as "Code Inspection"Steps to reproduce the behaviour
main.cpp
foo.cpp
The text was updated successfully, but these errors were encountered: