This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about new warning system
- From: DJ Delorie <dj at redhat dot com>
- To: rasky at develer dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 10 Jun 2005 10:04:30 -0400
- Subject: Re: Question about new warning system
- References: <025901c56dc2$20fbe7f0$bf03030a@trilan>
> if (OPT_Wmissing_braces)
> warning (OPT_Wmissing_braces, "missing braces around
> initializer");
FYI OPT_Wmissing_braces is an enum constant; it will always be nonzero.
> [3]
> warning (OPT_Wmissing_braces, "missing braces around initializer");
That is what we decided to do.
Note, however, if the logic required to determine if a warning is
warranted is sufficiently complex, *also* checking the variable is
considered an optimization:
if (warn_missing_braces
&& expensive_warning_check())
warning (OPT_Wmissing_braces, "...");
In this case, the warn_missing_braces check is done only to avoid
calling expensive_warning_check() if we know in advance we won't be
needing it.