C - Check for unused variables and defines
-
Is there a way or extension that can check for variables and definitions defined but not used? I am using Npp and Source Cookifier. I am just learning the plugins and also loaded linter, but it does seem to do anything.
Thanks in advance
-
@Robert-Lewis said in C - Check for unused variables and defines:
Is there a way or extension that can check for variables and definitions defined but not used?
Depending on the compiler used you can have different warnings set.
See, for example for gcc, https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html. -
To elaborate on what Eko is meaning is that you would set up a compiler to run a compile on your source file, and produce output for you which would indicate your “unused variables” in an output window.
Ideally the output window has clickable links which would take you to the point of the problem in your original source code.
This would be a “manual run” kind of thing; if you were looking for something that would be an “as you type” solution, I think you’re out of luck.
There is some good info in this vein to be found HERE.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login