This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Valarray: bug in binary operator
- To: Serge Barral <sbarral at ippt dot gov dot pl>
- Subject: Re: Valarray: bug in binary operator
- From: Gabriel Dos Reis <dosreis at cmla dot ens-cachan dot fr>
- Date: 19 Nov 1999 01:45:16 +0100
- Cc: libstdc++ at sourceware dot cygnus dot com, gcc at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS URA 1611 (France)
- References: <3833F2C3.8D6A7DAB@ippt.gov.pl>
Serge Barral <sbarral@ippt.gov.pl> writes:
| Hi,
|
| A code like the following would result in a core dump:
|
| valarray<double> A(1.0,80), B(80);
| B=A*(A+1);
|
|
| More generaly, a binary operator taking a valarray as first argument and
| a template expression as second argument gives either unexpected results
| or a segfault ( at least with the libstdc++ of gcc 2.95.1 and with
| libstdc++2.90.6 - I didn't try the cvs version).
|
| The patch below seems to adress this problem.
Thank you very much. As explained in
http://egcs.cygnus.com/ml/gcc-bugs/1999-10/msg00512.html
the bug was fixed a while ago. But for some administrative reasons,
the fix didn't find its way in the dot releases :-(
I hope the next release of GCC/valarray will be in sync with 2.96.
| Congratulation for your implementation of valarray. I was looking for
| something more lightweight than Blitz++, and your valarray really works
| fine: compilation is 5 time faster, and doesn't eat all my RAM (I didn't
| make a run-time comparison thought)
Thanks for you feedback. If you happen to do some runtime comparison,
please send me the results.
-- Gaby