Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5348611386 for ; Sat, 20 Sep 2014 08:12:17 +0000 (UTC) Received: (qmail 81822 invoked by uid 500); 20 Sep 2014 08:12:17 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 81769 invoked by uid 500); 20 Sep 2014 08:12:16 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 81759 invoked by uid 99); 20 Sep 2014 08:12:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Sep 2014 08:12:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brane@wandisco.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-we0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Sep 2014 08:12:11 +0000 Received: by mail-we0-f175.google.com with SMTP id x48so725133wes.20 for ; Sat, 20 Sep 2014 01:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=WKczHWmBLq4iRhduAGFYxdbaaV7umZ79GU19jzasGWU=; b=bDvrC1wnZD6Wght1SfWPPbzNKPtmC7Eq/meWg1jsYfe/qfnn4LnGUkpWBc1v5C2IyS 0nEuDzRAdmFpZjLmI2XpiU4UOjPWSeaogmGZXWU8nWzHYcZ77mzASaa4Na5Y/cNYPRkg 1vWhnLA3qoyGLENnTBAbPEFoAxC6AJxhHxfAA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type; bh=WKczHWmBLq4iRhduAGFYxdbaaV7umZ79GU19jzasGWU=; b=E4yWxPpvB7VKmxCgo2Fm0qNs5spu6uoa8gi541z0fozhwsJXFuIKlFhR5zexDXUMWx K0qdG6N9CRMOULD/UWrMwBP1THU7gxHqHDlRH4kkMksQsl93+FUW3zH7Kp9TmVJJXC3r ZiSyhvRVt0P2XuMCnnPw03V07NbSU8XCx+8L2QwWWqRG4rQBJM4QN9Bkg+YNtw52fSRw y5E0QCjEKgvqiJh2QHdyFnfMEzRhrZGzWD+nYx+SB6JPIz1bD6zvSBBvWbe9dqaV0iMG WtkW6ahfVSCPppyq3kC5mWcmfIU4aia5xNiAWINb9S2xTp2FZZOJwEFIyNvrZyiv5CPS Gd3Q== X-Gm-Message-State: ALoCoQlKFfO84RXU9UG0BPIaZEqQlOz7vzf1oo9YofxpcAZVsJ5W/9IYakk9xjzp0iLw7TK0WBTU X-Received: by 10.180.105.41 with SMTP id gj9mr1928830wib.3.1411200709297; Sat, 20 Sep 2014 01:11:49 -0700 (PDT) Received: from zulu.local (cpe-62-84-228-88.dynamic.amis.net. [62.84.228.88]) by mx.google.com with ESMTPSA id fv1sm4714444wjb.35.2014.09.20.01.11.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 20 Sep 2014 01:11:48 -0700 (PDT) Received: from zulu.local (localhost [IPv6:::1]) by zulu.local (Postfix) with ESMTP id A7ECBC80EA12 for ; Sat, 20 Sep 2014 10:11:49 +0200 (CEST) Message-ID: <541D36C5.1030903@wandisco.com> Date: Sat, 20 Sep 2014 10:11:49 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Subversion Development Subject: Re: svn commit: r1626247 - /subversion/trunk/subversion/libsvn_ra_svn/client.c References: <20140919152115.6FDAF23889E1@eris.apache.org> In-Reply-To: <20140919152115.6FDAF23889E1@eris.apache.org> Content-Type: multipart/alternative; boundary="------------000900000200020306060203" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------000900000200020306060203 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19.09.2014 17:21, ivan@apache.org wrote: > Author: ivan > Date: Fri Sep 19 15:21:15 2014 > New Revision: 1626247 > > URL: http://svn.apache.org/r1626247 > Log: > Resolve another compiler warning. > > * subversion/libsvn_ra_svn/client.c > (find_tunnel_agent): Add non-const local variable ARGV to fix compiler > warning. Which compiler is that, and what warning does it emit? There is nothing wrong with the code, and I've not seen any warnings from that code in ages, with either gcc or clang. Specifically: > -/* (Note: *ARGV is an output parameter.) */ > +/* (Note: *ARGV_P is an output parameter.) */ > static svn_error_t *find_tunnel_agent(const char *tunnel, > const char *hostinfo, > - const char ***argv, > + const char ***argv_p, > apr_hash_t *config, apr_pool_t *pool) The original 'argv' parameter is *not* constant. It is a non-const pointer to a non-const array of (const char*). There should be no warnings when assigning to the pointer, and no warnings when modifying the array. The only thing you can't do is modify the data the array elements are pointing to, but the code did not do that. Incidentally, I agree with using a for-loop to copy the initial argument array instead of a memcpy; it makes the intent of the code clearer. OTOH, I really do not like code changes that cater to broken compilers. -- Brane --------------000900000200020306060203 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 19.09.2014 17:21, ivan@apache.org wrote:
Author: ivan
Date: Fri Sep 19 15:21:15 2014
New Revision: 1626247

URL: http://svn.apache.org/r1626247
Log:
Resolve another compiler warning.

* subversion/libsvn_ra_svn/client.c
  (find_tunnel_agent): Add non-const local variable ARGV to fix compiler 
   warning.


Which compiler is that, and what warning does it emit? There is nothing wrong with the code, and I've not seen any warnings from that code in ages, with either gcc or clang. Specifically:


-/* (Note: *ARGV is an output parameter.) */
+/* (Note: *ARGV_P is an output parameter.) */
 static svn_error_t *find_tunnel_agent(const char *tunnel,
                                       const char *hostinfo,
-                                      const char ***argv,
+                                      const char ***argv_p,
                                       apr_hash_t *config, apr_pool_t *pool)

The original 'argv' parameter is not constant. It is a non-const pointer to a non-const array of (const char*). There should be no warnings when assigning to the pointer, and no warnings when modifying the array. The only thing you can't do is modify the data the array elements are pointing to, but the code did not do that.

Incidentally, I agree with using a for-loop to copy the initial argument array instead of a memcpy; it makes the intent of the code clearer.

OTOH, I really do not like code changes that cater to broken compilers.

-- Brane

--------------000900000200020306060203--