From 4693e81c0271b76292bcb8455824e01ee0f7ba50 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sat, 30 Jul 2022 10:17:58 -0700 Subject: [PATCH] Avoid array-comparison warning. --- src/common/container.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/container.h b/src/common/container.h index 8122fca..098a1c2 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -74,7 +74,8 @@ class FixedArray { private: void CopyFrom(const FixedArray &other) { - if (data_ != other.data_) memcpy(data_, other.data_, sizeof(data_)); + // Unary + to decay array to pointer and avoid array-comparison warning. + if (+data_ != +other.data_) memcpy(data_, other.data_, sizeof(data_)); } T data_[N];