[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] Re: Bug-gsl GSL on Solaris problems
From: |
Brian Gough |
Subject: |
[Bug-gsl] Re: Bug-gsl GSL on Solaris problems |
Date: |
Thu, 01 Nov 2007 16:21:54 +0000 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/22.1 Mule/5.0 (SAKAKI) |
At Tue, 30 Oct 2007 14:02:14 +0100 (CET),
Richard Guenther wrote:
>
>
> This also occurs on linux with GCC 4.3 and the problem is likely that
> the overflow check in
>
> void
> FUNCTION (my, initialize) (TYPE (gsl_vector) * v)
> {
> size_t i;
> ATOMIC k = 0, kk;
>
> /* Must be sorted initially */
>
> for (i = 0; i < v->size; i++)
> {
> kk = k;
> k++;
> if (k < kk) /* prevent overflow */
> k = kk;
> FUNCTION (gsl_vector, set) (v, i, k);
> }
> }
>
> is broken for signed integral values. As the ISO C standard defines
> signed integer overflow as invoking undefined behavior, the post-the-fact
> check is optimized away by compilers. That this triggers only the signed
> char case is probably due to the sizes not causing overflow on other
> singed integral tests.
Thanks for the information, I'll fix that in the next release.
--
Brian Gough
GNU Scientific Library -
http://www.gnu.org/software/gsl/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] Re: Bug-gsl GSL on Solaris problems,
Brian Gough <=