Re: how to warn on unused preprocessor defines...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



charlie wrote:
> There are hundreds of them that are suspect.  (project inherited from
> someone else who went a little crazy with the #defines... #defines we
> will never ever use)
>
> That's the problem.  I want the compiler to help me out a little.

Try using "-Wunused-macros", documented in the man pages for gcc and cpp.

I haven't tried it, but that might do what you want.

Be prepared for a lot of output, because it will only be able to tell you which macros are used in each compilation unit, not across your entire project. So, presumably it will tell you about the same unused macros in every single source file that you compile.

--
Tony Wetmore



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux