On Thu, 20 Feb 2025 at 17:06, Thomas Schwinge <tschwi...@baylibre.com> wrote: > > Hi! > > In the following, a few patches for libstdc++ to avoid > '-Wunused-parameter' diagnostics (actually '-Werror=unused-parameter', > for my '--enable-werror' builds). So far, only build-tested for GCN, > nvptx. Are these changes OK? > > What are exactly the semantics for '_GLIBCXX_THROW_OR_ABORT', should this > evaluate its argument for '!__cpp_exceptions' or not? For example, > compare to how 'gcc/system.h:gcc_checking_assert' gets defined so that > "in release build EXPR is not evaluated".
See my comment on that patch. I don't see any reason to evaluate the argument, and I've written code using that macro which very definitely assumes it *won't* be evaluated. > The other patches do similar to how '[[maybe_unused]]' appears to be used > elsewhere, or should we rather '(void)' cast only in the specific '#if' > regions where the variables are actually unused? No, [[maybe_unused]] is the right fix.