From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Received: (qmail 26249 invoked from network); 10 Jan 2003 14:34:58 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 10 Jan 2003 14:34:58 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18X27g-0004SM-00 for ; Fri, 10 Jan 2003 10:35:09 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18X0FL-0000vP-00 for ; Fri, 10 Jan 2003 09:34:55 -0500 Date: Fri, 10 Jan 2003 14:34:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [RFC] trying to kill a warning in hpread.c (from call to complaint) Message-ID: <20030110143454.GA3492@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20030110142639.GC30359@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030110142639.GC30359@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00399.txt.bz2 On Fri, Jan 10, 2003 at 06:26:39PM +0400, Joel Brobecker wrote: > Hello, > > I see the following warnings when compiling hpread.c: > > hpread.c:1920: warning: int format, pointer arg (arg 3) > hpread.c:2025: warning: int format, pointer arg (arg 3) > hpread.c:2051: warning: int format, pointer arg (arg 3) > hpread.c:2072: warning: int format, pointer arg (arg 3) > hpread.c:2146: warning: int format, pointer arg (arg 3) > hpread.c:2230: warning: int format, pointer arg (arg 3) > > These warnings point to the following macro: > > #define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \ > if (! hpread_has_name ((SYM)->dblock.kind)) \ > *NAMEP = ""; \ > else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \ > { \ > complaint (&symfile_complaints, "bad string table offset in symbol %d", \ > (char *) symnum); \ > *NAMEP = ""; \ > } \ > else \ > *NAMEP = (SYM)->dsfile.name + VT (OBJFILE) > > I think that the warning comes from the call to complaint where the > format string contains "%d", but the next parameter is casted to a > "char *". > > Is the cast to "char *" necessary? Can/Should I remove it? Looks like a typo in Kevin's complaint patch. I'd say yes; and in the calls to lbrac_unmatched_complaint, too. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer