https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66918
Hime Haieto <himehaieto at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |himehaieto at gmail dot com --- Comment #13 from Hime Haieto <himehaieto at gmail dot com> --- For specific functions, annotating them with __attribute__((unused)) (pre-c++17) or [[maybe_unused]] (c++17 and beyond) removes this warning with clang but not g++. For all functions, using -Wno-unused works for both clang and g++, at least going back as far as g++ 12.2.0. The diagnostic disparity with the unused attribute not working for g++ is what needs to be fixed. See PR116729 for the related report for c code.