Forum Discussion
Altera_Forum
Honored Contributor
14 years agoA quick look in the gcc sources (having repoduced the error message with a random gcc 4.1.2 since you misquoted it) shows it being generated in c_finish_if_stmt() in c-typeck.c.
The code is inside 'if (extra_warnings)' - probably set by -Wextra, and is: warning (0, "%Hempty body in an else-statement",
EXPR_LOCUS (*inner_else));Compare this against, a few lines higher: warning (OPT_Wparentheses,
"%Hsuggest explicit braces to avoid ambiguous %<else%>",
&if_locus);My guess is that the first argument to warning() maps onto the flag to enable/disable the warning. So you are probably out of luck.