From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31996 invoked by alias); 20 Nov 2003 03:22:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31986 invoked by alias); 20 Nov 2003 03:22:31 -0000 Date: Thu, 20 Nov 2003 03:22:00 -0000 Message-ID: <20031120032231.31985.qmail@sources.redhat.com> From: "gdr at integrable-solutions dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031119101223.13121.Uwe.Seimet@seimet.de> References: <20031119101223.13121.Uwe.Seimet@seimet.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/13121] Wanted: check in valarray::operator= for length of array X-Bugzilla-Reason: CC X-SW-Source: 2003-11/txt/msg01800.txt.bz2 List-Id: ------- 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" 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