https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96063
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot
gnu.org
Status|REOPENED |ASSIGNED
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning routine checks the warning state and returns without doing anything
when it's set:
if (!warn_mismatched_tags)
return;
It then calls warning_at() assuming the calls necessarily succeed, and doesn't
check their return value before calling inform(). That only works for global
settings of the warnings but not for local overrides via #pragmas. Let me fix
it. Longer term, we need a functional API to query whether warnings are
enabled, one that takes their context into consideration. Checking the global
variable is almost never right.