Community
    • Login

    C - Check for unused variables and defines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 762 Views
    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 LewisR
      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

      EkopalypseE Alan KilbornA 2 Replies Last reply Reply Quote 0
      • EkopalypseE
        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 KilbornA
          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
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors