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 19466 invoked from network); 10 Jan 2003 16:08:48 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by 209.249.29.67 with SMTP; 10 Jan 2003 16:08:48 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EABB93E02; Fri, 10 Jan 2003 11:08:37 -0500 (EST) Message-ID: <3E1EF005.5060906@redhat.com> Date: Fri, 10 Jan 2003 16:08:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] trying to kill a warning in hpread.c (from call to complaint) References: <20030110142639.GC30359@gnat.com> <20030110143454.GA3492@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00405.txt.bz2 >> 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. Nope. The original code was broken: complain (&string_table_offset_complaint, (char *) symnum); (complaint -> complaints finds another victim / bug). > I'd say yes; and in the calls to lbrac_unmatched_complaint, too. Joel, if you encounter a macro, first thing to do is always to convert it to a function :-) Andrew