Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Wednesday 26 of September 2012, Michael Meeks wrote:
On Tue, 2012-09-25 at 14:26 +0200, Stephan Bergmann wrote:
  Neato :-) the deeper question - as to why no warnings are popping out
of the compiler for this when (surely) it's a trivial thing to check /
warn for - is more concerning.

Such a warning option has never been there AFAIK.

      Oh - must be me mis-remembering it, or remembering valgrind output that
catches that, silly me.

There is no way for the compiler to decide this in general (unlike Java,
C++ does not have restricting rules to allow the compiler to do so).

      no way ? surely there is - add a warning for un-initialized POD members
on the exit of the constructor. It seems that fools seldom differ, and
there is such a patch here:

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

      Doesn't seem to be going anywhere in the last month, but - you can but
hope :-)

 I don't think it can go anywhere practical:

class A
{
bool foo;
void init();
public:
A() { init(); }
};

 How should the compiler know?

-- 
 Lubos Lunak
 l.lunak@suse.cz

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.