This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53072] automatically set Init() only if option was not set in some other way
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Apr 2012 14:43:16 +0000
- Subject: [Bug c/53072] automatically set Init() only if option was not set in some other way
- Auto-submitted: auto-generated
- References: <bug-53072-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53072
--- Comment #3 from joseph at codesourcery dot com <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").