public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39798]  New: would like flag to disable constructors for built-in types
@ 2009-04-17 17:40 kraftche at cae dot wisc dot edu
  2009-04-20 15:28 ` [Bug c++/39798] " falk at debian dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kraftche at cae dot wisc dot edu @ 2009-04-17 17:40 UTC (permalink / raw)
  To: gcc-bugs

In C++, the statement 'k = int()' will zero 'k'.  This somewhat inconsistent
behavior (e.g. initialize a struct with a default constructor is a no-op) is
somewhat annoying because it results in all STL containers zeroing their
contents.  I've encountered a few rare cases where this resulted in a
significant performance hit but the most annoying part is that it prevents
tools like valgrind from detecting the use uninitialized values taken from STL
containers.  It would be nice if g++ had a flag to optionally disable this
behavior (make the constructors for build-in types be no-ops.)


-- 
           Summary: would like flag to disable constructors for built-in
                    types
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kraftche at cae dot wisc dot edu


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-21 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-17 17:40 [Bug c++/39798] New: would like flag to disable constructors for built-in types kraftche at cae dot wisc dot edu
2009-04-20 15:28 ` [Bug c++/39798] " falk at debian dot org
2009-04-20 15:52 ` kraftche at cae dot wisc dot edu
2009-04-20 15:59 ` paolo dot carlini at oracle dot com
2009-04-21 18:14 ` pinskia at gcc dot gnu dot org

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).