From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2568 invoked by alias); 4 Aug 2003 14:06:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2561 invoked from network); 4 Aug 2003 14:06:02 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 4 Aug 2003 14:06:02 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A29502B7F; Mon, 4 Aug 2003 10:05:43 -0400 (EDT) Message-ID: <3F2E6837.4010201@redhat.com> Date: Mon, 04 Aug 2003 14:06:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Carlton Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] some -Wformat-nonliteral changes References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00029.txt.bz2 > As promised, here are the easy -Wformat-nonliteral changes. Most of > them consist of replacing calls like fprintf(stream, foo) with > fputs(foo, stream). A few of them consist of replacing error(msg) > with error("%s",msg). And one of them is an actual bug fix - there's > a call to internal_error that left out __FILE__ and __LINE__. Insert expression of disbelief: > - internal_error ("Error converting character `%d' from `%s' to `%s' " > + internal_error (__FILE__, __LINE__, > + "Error converting character `%d' from `%s' to `%s' " > "character set: %s", > from_char, ci->from->name, ci->to->name, > safe_strerror (errno)); The other changes are also, arguably, bug fixes. There's no guarentee that there isn't a % in the buffer. > Having said that, there's still a lot of warnings triggered by > -Wformat-nonliteral; some of them are in situations with a fairly easy > workaround, but some of them are a little more delicate. I would > definitely recommend that the -Wformat-nonliteral patch be reverted > for the time being, because it's breaking compiles for some of us. > > I've tested this with GCC 3.2, i686-pc-linux-gnu, DWARF-2; no new > regressions. It also doesn't turn up any regressions on GDB 6.0; I'd > lean towards applying the internal_error bug fix part of it to the > branch, but I don't have much of an opinion one way or another about > applying the entire patch. > > OK to apply? It should all be obvious, but I might as well have > another set of eyes proofreading it. Yes, ok, and yes, the internal_error patch should go onto the branch. Before reverting -Wformat-nonliteral, I'd like to see exactly what the damange is - it's clearly finding bugs. Andrew