From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11501 invoked by alias); 23 Oct 2013 08:24:14 -0000 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 Received: (qmail 11463 invoked by uid 48); 23 Oct 2013 08:24:11 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/39589] make -Wmissing-field-initializers=2 work with "designated initializers" ? Date: Wed, 23 Oct 2013 08:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01666.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D39589 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Szikra Istv=C3=A1n from comment #1) > I have the same (or similar) problem, and would like to have an option to > enable warnings for incomplete structure initialization with designated > initializers, where not all fields were explicitly assigned.=20 I don't think GCC devs would be against this in principle if someone provid= ed a sensible patch: http://gcc.gnu.org/contribute.html The relevant code is at gcc/c/c-typeck.c: pop_init_level /* Warn when some struct elements are implicitly initialized to zero. */ if (warn_missing_field_initializers && constructor_type && TREE_CODE (constructor_type) =3D=3D RECORD_TYPE && constructor_unfilled_fields) { bool constructor_zeroinit =3D (vec_safe_length (constructor_elements) =3D=3D 1 && integer_zerop ((*constructor_elements)[0].value)); /* Do not warn for flexible array members or zero-length arrays. */ while (constructor_unfilled_fields && (!DECL_SIZE (constructor_unfilled_fields) || integer_zerop (DECL_SIZE (constructor_unfilled_fields= )))) constructor_unfilled_fields =3D DECL_CHAIN (constructor_unfilled_fields); if (constructor_unfilled_fields /* Do not warn if this level of the initializer uses member designators; it is likely to be deliberate. */ && !constructor_designated /* Do not warn about initializing with ` =3D {0}'. */ && !constructor_zeroinit) { if (warning_at (input_location, OPT_Wmissing_field_initializers, "missing initializer for field %qD of %qT", constructor_unfilled_fields, constructor_type)) inform (DECL_SOURCE_LOCATION (constructor_unfilled_fields), "%qD declared here", constructor_unfilled_fields); } } Perhaps sinking the !constructor_designated check into the if, and adding an 'else'? Or simply deleting the check and doing: if (warning_at (input_location,=20 !constructor_designated check ? OPT_Wmissing_field_initializers : OPT_Wmissing_field_initializers_2, where OPT_Wmissing_field_initializers_2 corresponds to a new option Wmissing-field-initializers=3D2 that needs to be added to c.opt (and docume= nted in doc/invoke.texi). >>From gcc-bugs-return-432523-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 23 08:42:11 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 27053 invoked by alias); 23 Oct 2013 08:42:11 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 27010 invoked by uid 48); 23 Oct 2013 08:42:06 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/58828] Problem compiling gcc 4.8.2 using gcc 4.4.6 Date: Wed, 23 Oct 2013 08:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01667.txt.bz2 Content-length: 1813 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58828 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |build Status|UNCONFIRMED |WAITING Last reconfirmed| |2013-10-23 Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- gengtype includes double-int.h and builds with -fkeep-inline-functions which breaks as double-int.h refers to functions in double-int.c which is not linked in. My attempt to reproduce this doesn't get me -fkeep-inline-functions though. There is # This pulls in tm-pred.h which contains inline functions wrapping up # predicates from the back-end so those functions must be discarded. # No big deal since gencondmd.c is a dummy file for non-GCC compilers. build/gencondmd.o : \ BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS)) in Makefile.in which hints that this kind of issue has hit us before. It also seems that -fkeep-inline-functions was removed from the toplevel with 2009-06-23 Ian Lance Taylor * configure.ac: Add --enable-build-with-cxx. When set, add c++ to boot_languages. Only bootstrap target libraries listed in target_libs for some boot language. Add --with-stage1-ldflags, --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. Remove with_host_libstdcxx from ppllibs. Only add -fkeep-inline-functions if not building with C++. as I can find no reference of it on the 4.8 branch. So, please check where -fkeep-inline-functions is coming from in your build.