Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I detect unused macro definitions & typedefs?

Tags:

c++

c

It's easy to get a list unused functions and variables with linker feedback, but how can I detect those unused macro definitions & typedefs? Do I have to browse the code line by line and git grep in the whole project?

like image 582
xdan Avatar asked May 15 '13 02:05

xdan


1 Answers

For macros defined in source files you might try -Wunused-macros gcc/clang flag. There's also -Wunused-local-typedefs in gcc.

like image 93
yachoor Avatar answered Oct 13 '22 01:10

yachoor