From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2260 invoked by alias); 24 Apr 2012 14:44:35 -0000 Received: (qmail 2235 invoked by uid 22791); 24 Apr 2012 14:44:34 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Apr 2012 14:44:20 +0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53072] automatically set Init() only if option was not set in some other way Date: Tue, 24 Apr 2012 14:44: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-04/txt/msg02142.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53072 --- Comment #3 from joseph at codesourcery dot com 2012-04-24 14:43:16 UTC --- On Tue, 24 Apr 2012, manu at gcc dot gnu.org wrote: > Say we have: A enables B enables C. Do we actually need to track that C was > enabled by B or by A? Sorry I cannot imagine what for. The idea is that -WB -Wno-B leaves C disabled, but -WB -Wno-A leaves it enabled (because -WB is more specific than -Wno-A, it takes precedence whatever the ordering of those two options). If there were any option -WC or -Wno-C on the command line, the last such option would apply regardless of the -WA / -Wno-A / -WB / -Wno-B options (that much at least is already implemented for some option implications). > For warning options, it is sufficient to track the C was enabled by other > option different from C. It seems we have most of the infrastructure to do Even for that, you still need to move away from _set being a boolean, since there will be three values (default, explicit -WC / -Wno-C, controlled by some other option but not the most specific option). > this, however, it is unclear how to use this infrastructure to make Init() > useful again, or implement PR 53063. Init() should I think ideally be just for the defaults (with _set replacing the present uses of -1 or 2 in Init to mean "not set").