On Fri, Jan 30, 2026 at 03:28:56PM +0100, Michal Jires wrote:
> The suppression code disables warning categories in nowarn_spec_t; both
> are in the same category NW_LEXICAL, so they are equivalent for now.
Ugh, I thought it is more fine-grained than that.
> So I think we should rather be more specific and use OPT_unused_function
> in cgraphunit.cc, same as its warning.
The question is if all those suppressions which suppress Wunused mean
to suppress also the cgraphunit.c and C++ FE pedwarn/warning or not.
Right now it will as they work the same, but if ever the code
is changed to use different bits between the two, it would regress.
decl2.cc- /* Suppress warning from check_global_declaration if needed. */
decl2.cc- if (d)
decl2.cc: suppress_warning (decl, OPT_Wunused);
etc. at least in the C++ FE mean to disable the cgraphunit.cc diagnostics.
So I think going for OPT_Wunused for suppress_warning/warning_suppressed_p
would be easiest.
Jakub