From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33367 invoked by alias); 5 Apr 2017 13:10:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 33125 invoked by uid 89); 5 Apr 2017 13:10:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=wondering X-HELO: mail-wr0-f179.google.com Received: from mail-wr0-f179.google.com (HELO mail-wr0-f179.google.com) (209.85.128.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Apr 2017 13:10:32 +0000 Received: by mail-wr0-f179.google.com with SMTP id w43so13480134wrb.0 for ; Wed, 05 Apr 2017 06:10:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=U6tYozdtH4N03Gh55kH+3KUlWJTwWQBrTHbGpHhWdpg=; b=I6If+ji0ANMzKUbsDYc7+dWTJ1U74Kn70XZLqXQZFSTWJT30oxpZcseSwUcFkGANxG vV1qSGvmHIfW584U1lrFJMW38/zzvdsuvNN3eDWXrnqtlinLtgNfygw1NenE83qO0ZQR +O6XhcuxJwud8uqaLM9NNzDZBNMiuPsocuXlaYugrRFkWctgmZKjNe9yznnIpkZPj7nA Mfs3MU5H8hPbigrM+yzIyHXWzNYLE/H7J0xE8s6ZRSmJWH5dJ37ozmzvIiH/0gbIzywc wmahzx+ifC+r0BeW17ow/rH5Xcdw/pnRQpWXHoYqZSRWWf61aynL/xCC+xT8pmRdnKdp lNiA== X-Gm-Message-State: AFeK/H0GLkuGzxnRkqX5lxFlMWYsTd9JhhPjkAvPp3DLsute3hz6gJciFz9laN/OEnmnvGXd X-Received: by 10.223.147.98 with SMTP id 89mr23018191wro.99.1491397830565; Wed, 05 Apr 2017 06:10:30 -0700 (PDT) Received: from [192.168.0.100] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id w186sm421955wme.26.2017.04.05.06.10.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 06:10:29 -0700 (PDT) Subject: Re: [PATCH 15/18] -Wwrite-strings: execute_command calls with string literals To: "Metzger, Markus T" , "gdb-patches@sourceware.org" References: <1491326751-16180-1-git-send-email-palves@redhat.com> <1491326751-16180-16-git-send-email-palves@redhat.com> From: Pedro Alves Message-ID: Date: Wed, 05 Apr 2017 13:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-04/txt/msg00099.txt.bz2 On 04/05/2017 08:13 AM, Metzger, Markus T wrote: > The patch looks good to me. But I'm wondering if we should instead change > execute_command to take a const char *. That's not that simple, because some commands do want to modify the input string. For example, cli/cli-cmds.c:list_command does: /* If this command is repeated with RET, turn it into the no-arg variant. */ if (from_tty) *arg = 0; and also, it'd require a lot of cascading constification inside many commands, because lots of command args processing passes "&args" to some routine that expects a "char **". Thanks, Pedro Alves