From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19293 invoked by alias); 19 Aug 2014 22:28:39 -0000 Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org Received: (qmail 19278 invoked by uid 89); 19 Aug 2014 22:28:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ipmx5.colorado.edu Received: from ipmx5.colorado.edu (HELO ipmx5.colorado.edu) (128.138.128.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Aug 2014 22:28:36 +0000 From: Patrick Alken Received: from bonanza.ngdc.noaa.gov ([140.172.179.41]) by smtp.colorado.edu with ESMTP/TLS/DHE-RSA-AES128-SHA; 19 Aug 2014 16:28:34 -0600 Message-ID: <53F3CF92.3030209@colorado.edu> Date: Tue, 19 Aug 2014 22:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: gsl-discuss@sourceware.org Subject: Re: const gsl_vector * References: <53EAAB60.3080701@lanl.gov> <53F3164F.50508@btinternet.com> In-Reply-To: <53F3164F.50508@btinternet.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2014-q3/txt/msg00002.txt.bz2 On 08/19/2014 03:18 AM, John D Lamb wrote: > > I mainly use C++. But I think C now works so that you could use > > gsl_vector* const v > > in place of a > > const gsl_vector* v > > argument, and get the desired result. > > I don’t know if there would be unintended consequences of rewriting the > arguments of the GSL functions this way. I know that C can’t handle both of > > int function( const gsl_vector* v ); > int function( gsl_vector* const v ); > > in the same code. So it would need a rewrite. > > One issue would be that if the code were rewritten any code that passed > a const gsl_vector* argument would cause a compilation failure. The > workaround might be to use a > > gsl_vector const* const v > > argument. But I don’t know if that would cause problems, for example > with older compilers. > I don't have a solution to this problem, but with my gcc (4.4.7), changing to gsl_vector* const doesn't fix the issue. Compiling with -Wall -W produces no warnings and the program runs as before.