cppu/source/uno/check.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 2c6cea672a852b85cfb6d2e313d806f257481417
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed May 18 10:46:55 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed May 18 11:42:14 2022 +0200

    Work around bogus -Werror=attributes with old GCC
    
    ...after 9c3c6a6b661ea8f84c1285b07a502de5c98a1495 "Replace OFFSET_OF macro 
with
    a function template", as seen at
    <https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/38076/>,
    
    > 
/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 <sberg...@redhat.com>

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;
 };
 

Reply via email to