This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/31368] basic_string and unsigned short leads to memory fault
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Mar 2007 18:22:06 -0000
- Subject: [Bug libstdc++/31368] basic_string and unsigned short leads to memory fault
- References: <bug-31368-14317@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from pcarlini at suse dot de 2007-03-27 19:22 -------
Ok, now I see. The kind of issue is unfortunately known, akin to 24196 for
example, and ultimately due to the special, optimized way we are dealing with
empty strings, not allocating dynamic memory at all. I don't think we can
really solve the problem without breaking the binary compatibility of the
entire library, therefore we suggest various options:
1- Make sure to never deal with empty strings (which means a string not holding
a memory buffer, that's why reserve(1) works, for example)
2- Rebuild the library passing --enable-fully-dynamic-string, the option has
been added exactly to help users in this case.
3- Switch to a different implementation of the string class: in recent releases
we are offering one under <ext/vstring.h> (will become standard when we decide
to break binary compatibility)
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|WAITING |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-03-27 19:22:05
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31368