public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Resolved] how to warn on unused preprocessor defines...
@ 2008-01-11 18:25 charlie
  0 siblings, 0 replies; only message in thread
From: charlie @ 2008-01-11 18:25 UTC (permalink / raw)
  To: uber; +Cc: gcc-help


Found it:

-Wunused-macros


#include <stdio.h>

#define aaa 1
#define bbb 2
#define ccc 3

int main()
{
	printf("%d:%d\n", aaa, ccc);
	return 0;
};


> gcc -Wunused-macros -o test test.c
test.c:4:1: warning: macro "bbb" is not used


- chuck




On January 10, 2008, 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.
> 
> Thanks.
> 
> - chuck
> 
> 
> 
> On January 10, 2008, Andrew Bell wrote:
> 
>> On Jan 10, 2008 1:51 PM, charlie <uber@juun.com> wrote:
>>> 
>>> How can I tell gcc/cpp to warn on (or in some other way point out)
>>> unused preprocessor defines?
>> 
>> Comment them out and see if the compiler complains.
>> 
>> -- 
>> Andrew Bell
>> andrew.bell.ia@gmail.com
>> 
> 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-10 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-11 18:25 [Resolved] how to warn on unused preprocessor defines charlie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).