This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/13121] Wanted: check in valarray::operator= for length of array
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Nov 2003 03:22:31 -0000
- Subject: [Bug libstdc++/13121] Wanted: check in valarray::operator= for length of array
- References: <20031119101223.13121.Uwe.Seimet@seimet.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2003-11-20 03:22 -------
Subject: Re: Inserting struct with valarray in map fails
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| The reason why the standard says this is undefined behavior is that
| the creators of valarray wanted to have maximum speed for this class.
Valarray was designed to be a low level building block for superscalar
computers. In particular, jumps are "conceptually" minimized.
| A check for the length and possibly throwing an exception might sacrifice
| this goal, although it would of course be much cheaper than the actual
| memory allocation this "feature" is to prevent. I leave this up to
| the libstdc++ maintainers -- maybe their new debug mode lib has this
| fixed already.
I have no plan to go there.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13121