From: Patrick Alken <patrick.alken@Colorado.EDU>
To: gsl-discuss@sourceware.org
Subject: Re: const gsl_vector *
Date: Tue, 19 Aug 2014 22:28:00 -0000 [thread overview]
Message-ID: <53F3CF92.3030209@colorado.edu> (raw)
In-Reply-To: <53F3164F.50508@btinternet.com>
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.
next prev parent reply other threads:[~2014-08-19 22:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 0:03 Gerard Jungman
2014-08-19 9:19 ` John D Lamb
2014-08-19 22:28 ` Patrick Alken [this message]
2014-08-20 6:37 ` John D Lamb
2014-08-19 22:33 ` Patrick Alken
2014-08-27 0:08 ` Gerard Jungman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F3CF92.3030209@colorado.edu \
--to=patrick.alken@colorado.edu \
--cc=gsl-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).