This is the mail archive of the
libstdc++-prs@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: libstdc++/2: valarray assignment operators don't resize
- To: nobody AT sourceware.cygnus dot com
- Subject: Re: libstdc++/2: valarray assignment operators don't resize
- From: Gabriel Dos Reis <dosreis AT cmla.ens-cachan.fr>
- Date: 14 Sep 1999 13:17:00 -0000
- Cc: libstdc++-prs AT sourceware.cygnus dot com,
- Reply-To: Gabriel Dos Reis <dosreis AT cmla.ens-cachan.fr>
The following reply was made to PR libstdc++/2; it has been noted by GNATS.
From: Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
To: Benjamin Kosnik <bkoz@cygnus.com>
Cc: rob@geonexuscorp.com, libstdc++-gnats@sourceware.cygnus.com,
gdr@sourceware.cygnus.com
Subject: Re: libstdc++/2: valarray assignment operators don't resize
Date: 14 Sep 1999 15:07:53 +0200
Benjamin Kosnik <bkoz@cygnus.com> writes:
| > >Number: 2
| > >Category: libstdc++
| > >Synopsis: valarray assignment operators don't resize
| > >Confidential: no
| > >Severity: serious
| > >Priority: high
| > >Responsible: unassigned
| > >State: open
| > >Class: sw-bug
| > >Submitter-Id: net
| > >Arrival-Date: Mon Aug 23 20:47:00 PDT 1999
| > >Closed-Date:
| > >Last-Modified:
| > >Originator: Robert Campbell
| > >Release: 2.90.6
| > >Organization:
| > >Environment:
| > RedHat Linux 5.2 with glibc libraries
| > >Description:
| > The various valarray<T>::operator=(...) methods do not
| > resize the object as it should.
They don't have to.
26.3.2.2 valarray assignment
1 ... The resulting behaviour is undefined if the length of the
argument array is not equal to the length of the *this array.
Furthermore:
26.3.2.6/3 If the array and the argument array do not have the same
length, the behavior is undefined.
I deliberately decided not to check array's length because valarrays
are basic building blocks and valarray operations are intended to be
primitive ones. It is the user's responsability to check bound, in the
same way he has to be cautious when deferencing pointer.
-- Gaby