This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54924] Warn for std::string constructor with wrong size
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Oct 2012 17:44:17 +0000
- Subject: [Bug libstdc++/54924] Warn for std::string constructor with wrong size
- Auto-submitted: auto-generated
- References: <bug-54924-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54924
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |diagnostic
Last reconfirmed| |2012-10-14
Component|c++ |libstdc++
Ever Confirmed|0 |1
Severity|normal |enhancement
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-14 17:44:17 UTC ---
(In reply to comment #0)
> In other words, std::string str('0', 100) is undefined behavior.
I assume you mean std::string str("0", 100)
We might be able to use
http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html