From 2c6cea672a852b85cfb6d2e313d806f257481417 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 18 May 2022 10:46:55 +0200 Subject: Work around bogus -Werror=attributes with old GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...after 9c3c6a6b661ea8f84c1285b07a502de5c98a1495 "Replace OFFSET_OF macro with a function template", as seen at , > /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/check.cxx:263:28: error: ‘maybe_unused’ attribute ignored [-Werror=attributes] > [[maybe_unused]] Char3 chars; > ^~~~~ (Not sure which versions of GCC are affected exactly; lets restrict this to GCC 7 for now.) Change-Id: I28ec8914b60c98dce769ad40ef4141aec4960aa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134509 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- cppu/source/uno/check.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cppu/source') diff --git a/cppu/source/uno/check.cxx b/cppu/source/uno/check.cxx index 60ab3dba4e30..e08b0065c4ed 100644 --- a/cppu/source/uno/check.cxx +++ b/cppu/source/uno/check.cxx @@ -260,7 +260,14 @@ static_assert(sizeof(second) == sizeof(int), "sizeof(second) != sizeof(int)"); struct Char4 { +#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattributes" +#endif [[maybe_unused]] Char3 chars; +#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__ +#pragma GCC diagnostic pop +#endif char c; }; -- cgit