public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Uwe dot Seimet at seimet dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/13121] Inserting struct with valarray in map fails
Date: Wed, 19 Nov 2003 15:12:00 -0000	[thread overview]
Message-ID: <20031119151217.8327.qmail@sources.redhat.com> (raw)
In-Reply-To: <20031119101223.13121.Uwe.Seimet@seimet.de>


------- Additional Comments From Uwe dot Seimet at seimet dot de  2003-11-19 15:12 -------
Subject: Re:  Inserting struct with valarray in map fails

Hello,

> That might well be that the standard is strange, but that's the way it is
> and I believe it is that way for a good reason.
> 
> In your case it's easy to fix the problem by having an assignment
> operator in your class that first sets the valarray to the right
> size before copying contents.

Yes, indeed. Just another question (or suggestion) on this: Would it be
possible for gcc to not simply ignore such an error condition but to throw
an exception, or assert, or whatever? In our actual (much larger) program,
where we encountered this problem, our program crashed with a floating point
exception in another piece of code. It was quite difficult to find out that
the problem was caused by the valarray assignment. If the gcc runtime had
aborted execution during the assignment it would have been much easier to
identify what was wrong.

Best regards,   Uwe



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13121


  parent reply	other threads:[~2003-11-19 15:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 10:12 [Bug c++/13121] New: " Uwe dot Seimet at seimet dot de
2003-11-19 14:34 ` [Bug libstdc++/13121] " bangerth at dealii dot org
2003-11-19 14:47 ` bangerth at dealii dot org
2003-11-19 15:00 ` Uwe dot Seimet at seimet dot de
2003-11-19 15:04 ` bangerth at dealii dot org
2003-11-19 15:12 ` Uwe dot Seimet at seimet dot de [this message]
2003-11-19 15:24 ` bangerth at dealii dot org
2003-11-19 15:25 ` [Bug libstdc++/13121] Wanted: check in valarray::operator= for length of array bangerth at dealii dot org
2003-11-20  3:19 ` gdr at integrable-solutions dot net
2003-11-20  3:22 ` gdr at integrable-solutions dot net
2004-06-18  4:45 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031119151217.8327.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).