Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    C - Check for unused variables and defines

    Help wanted · · · – – – · · ·
    3
    3
    133
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Robert Lewis
      Robert Lewis last edited by

      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

      Ekopalypse Alan Kilborn 2 Replies Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse @Robert Lewis last edited by Ekopalypse

        @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.

        1 Reply Last reply Reply Quote 3
        • Alan Kilborn
          Alan Kilborn @Robert Lewis last edited by

          @Robert-Lewis

          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.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors