This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about new warning system


Gabriel Dos Reis wrote:

As pointed out by JSM yesterday, it is not clear whether [1] should be
preferred over [2] or the converse.  I think having two ways to
control the same diagnostic is a bit confusing.  I think the

I'm inclined to agree it is confusing. especially as in one place one has to write warn_<foo> and in the other place one writes OPT_W<foo>. It'd be nice if one just wrote
if (warn_foo && frobbed)
warning ("foo is frobbed");


I don't care if it's spelt warn_foo, OPT_Wfoo, warning_p(foo) or whatever, so long as it's spelt only one way. The 'warning (OPT_Wfoo, ...)' syntax helps only where there is no conditional before the warning -- how often does that occur? The way it currently is, one runs the risk of writing
if (warn_c_cast
&& .....
&& .....
&& .....)
warning (OPT_Wconst_cast, ...)


nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]