This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/54924] Warn for std::string constructor with wrong size


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]