On 24/08/20 13:26 +0200, Krystian Kuźniarek via Libstdc++ wrote:
Hi,

First of all, sorry, I must have sent it as quoted-printable so spaces and
tabs are preserved.

A description of the problem/bug and how your patch addresses it:
I've got a small patch for -Wunused-variable and -Wunused-parameter in
system headers. These are needed either for:
1) __glibcxx_assert() that quickly goes away during an early compilation
step leaving the warning
2) code that conditionally is removed by preprocessor leaving the warning

Testcases:
N/A, it's only a warning.

ChangeLog:
Sorry, contrib/mklog.py didn't quite work for me.
For some reason after instruction in line 129: "diff = PatchSet(data)" my
"diff" variable is always empty.

Bootstrapping and testing:
Tested that manually by recompling GCC, unfolding all headers with
`#include <stdc++.h>` and compiling what's been included by it.

The patch itself:

diff --git a/libstdc++-v3/include/bits/atomic_base.h
b/libstdc++-v3/include/bits/atomic_base.h
index 015acef83c4..1fbb2d78d28 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -231,7 +231,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    _GLIBCXX_ALWAYS_INLINE void
    clear(memory_order __m = memory_order_seq_cst) noexcept
    {
-      memory_order __b = __m & __memory_order_mask;
+      memory_order __b __attribute__ ((__unused__)) =

Thanks for the patch.

Please put the line break before the '=' character i.e.

      memory_order __b __attribute__ ((__unused__))
        = __m & __memory_order_mask;

Other than that, the patch looks ok, and simple enough to not need a
copyright assignment for GCC.

A changelog entry and confirmation the testsuite still runs would be
preferred though.

Reply via email to