From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31143 invoked by alias); 10 Jan 2008 21:46:40 -0000 Received: (qmail 31134 invoked by uid 22791); 10 Jan 2008 21:46:40 -0000 X-Spam-Check-By: sourceware.org Received: from rs34.luxsci.com (HELO rs34.luxsci.com) (65.61.166.74) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 21:46:22 +0000 Received: from rs34.luxsci.com (localhost [127.0.0.1]) by rs34.luxsci.com (8.13.1/8.13.7) with ESMTP id m0ALkLBx002584; Thu, 10 Jan 2008 15:46:21 -0600 Received: (from lshttpd@localhost) by rs34.luxsci.com (8.13.1/8.13.7/Submit) id m0ALkLKg002581; Thu, 10 Jan 2008 21:46:21 GMT Message-Id: <200801102146.m0ALkLKg002581@rs34.luxsci.com> From: "charlie" Date: Fri, 11 Jan 2008 18:25:00 -0000 To: uber@juun.com Cc: gcc-help@gcc.gnu.org Reply-To: uber@juun.com Errors-To: uber@juun.com MIME-Version: 1.0 X-Comment: 48440-1678-1 Subject: Re: [Resolved] how to warn on unused preprocessor defines... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00098.txt.bz2 Found it: -Wunused-macros #include #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 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 >> >