diff --git a/ostd/context_stack.hh b/ostd/context_stack.hh index 72e2ab4..6f0aa73 100644 --- a/ostd/context_stack.hh +++ b/ostd/context_stack.hh @@ -379,9 +379,7 @@ public: stack_context allocate() { stack_node *nd = request(); std::size_t ss = p_stacksize - sizeof(stack_node); - auto *p = reinterpret_cast(nd) - ss; - /* avoid false-positive warning with GCC */ - static_cast(p); + [[maybe_unused]] auto *p = reinterpret_cast(nd) - ss; if constexpr(Protected) { detail::stack_protect(p, Traits::page_size()); } diff --git a/ostd/format.hh b/ostd/format.hh index 3de805c..fed196c 100644 --- a/ostd/format.hh +++ b/ostd/format.hh @@ -1152,9 +1152,9 @@ private: } template - void write_val(R &writer, bool escape, T const &val) const { - /* avoid false-positive warning with GCC */ - static_cast(escape); + void write_val( + R &writer, [[maybe_unused]] bool escape, T const &val + ) const { /* stuff fhat can be custom-formatted goes first */ if constexpr(detail::fmt_tofmt_test())>) { format_traits::to_format(val, writer, *this); @@ -1259,10 +1259,9 @@ private: template inline void write_range_item( - R &writer, bool escape, bool expandval, string_range fmt, T const &item + R &writer, bool escape, [[maybe_unused]] bool expandval, + string_range fmt, T const &item ) const { - /* avoid false-positive warning with GCC */ - static_cast(expandval); if constexpr(detail::is_tuple_like) { if (expandval) { std::apply([&writer, escape, &fmt, this]( @@ -1286,10 +1285,8 @@ private: template void write_range_val( - R &writer, F &&func, string_range sep, T const &val + R &writer, F &&func, [[maybe_unused]] string_range sep, T const &val ) const { - /* avoid false-positive warning with GCC */ - static_cast(sep); if constexpr(detail::iterable_test) { auto range = ostd::iter(val); if (range.empty()) { @@ -1334,10 +1331,8 @@ private: template void write_tuple_val( - R &writer, bool escape, string_range sep, T const &tup + R &writer, bool escape, [[maybe_unused]] string_range sep, T const &tup ) const { - /* avoid false-positive warning with GCC */ - static_cast(sep); format_spec sp{'s', p_loc, escape ? FMT_FLAG_AT : 0}; sp.write_arg(writer, 0, std::get(tup)); if constexpr(I < (N - 1)) { diff --git a/ostd/process.hh b/ostd/process.hh index 2aa9089..a87fa3a 100644 --- a/ostd/process.hh +++ b/ostd/process.hh @@ -402,10 +402,9 @@ public: private: template void open_full( - string_range cmd, InputRange1 args, InputRange2 env, bool use_path + string_range cmd, InputRange1 args, [[maybe_unused]] InputRange2 env, + bool use_path ) { - /* avoid false-positive warning with GCC */ - static_cast(env); static_assert( std::is_constructible_v< string_range, range_reference_t