From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17098 invoked by alias); 3 Jun 2003 22:08:34 -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 17063 invoked from network); 3 Jun 2003 22:08:33 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 3 Jun 2003 22:08:33 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 376E92B2F; Tue, 3 Jun 2003 18:08:22 -0400 (EDT) Message-ID: <3EDD1C56.3020102@redhat.com> Date: Tue, 03 Jun 2003 22:08: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: some const char * trivia References: <3EDD07CD.1020900@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00147.txt.bz2 > On Tue, 03 Jun 2003 16:40:45 -0400, Andrew Cagney said: > > >> I got slightly carried away with trying to eliminate some >> -Wwrite-strings errors. I'm trying to put the resultant mess on >> cagney_writestrings-20030508-branch. > > > Are you going to post patches, or are they too all-consuming/mindless > to matter? I wouldn't mind a brief description of changes you're > making. (E.g. what members of data structures are you turning into > const char *'s? All the name-like stuff?) The doco in the cli. It's where it tried to free it that I got scared :-) > Anyways, looking at the patch to linespec.c, I was shocked to see that > the changes were that simple, but actually you've been misled by the > compiler. Consider set_flags (from mainline, not from your branch): I was using an iterative process: - compile with -Wwrite-strings - change one function signature to const char * - compile with -Wno-write-strings - fix up the parameter passing/assignment mess - repeat. And gave up when things got really messy. So don't take the branch too seriously. I was carefully avoiding linespec. Andrew