From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4936 invoked by alias); 3 Jun 2010 08:48:16 -0000 Received: (qmail 4583 invoked by uid 48); 3 Jun 2010 08:47:28 -0000 Date: Thu, 03 Jun 2010 08:48:00 -0000 Message-ID: <20100603084728.4582.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/2972] -Wuninitialized could warn about uninitialized member variable usage in constructors In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg00294.txt.bz2 ------- Comment #10 from manu at gcc dot gnu dot org 2010-06-03 08:47 ------- (In reply to comment #9) > I've been experimenting with this patch, which warns if there is a missing > mem-initializer for a scalar. > > It gives a false positive for cases were the member is assigned to in the > constructor body, or otherwise initialized before use, but it's a start, and > has already helped me find some missing mem-initializers in real code. Nice but I am afraid there may be too many false positives. And what is different between this and the -Weffc++ warning given just below it? > > + case OPT_Wmeminit: > + warn_meminit = value; > + break; > + You do not need this. This is handled automatically when you defined Var in the opt files. -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|gdr at gcc dot gnu dot org |unassigned at gcc dot gnu | |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2972