From aaba06d2fca3264cd73093ffc048af27992bd0fb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 2 Aug 2023 17:33:27 +0200 Subject: [PATCH] Silence C++20 volatile increment deprecation warnings ...as seen with path set 2 of "Bump baseline to C++20", > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19: > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16: > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void enter() { gnEnterCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void leave() { gnLeaveCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void enter() { gnEnterCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:54:19: note: in instantiation of member function 'CrashZone::enter' requested here > CrashZone() { enter(); } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: note: in instantiation of member function 'CrashZone::CrashZone' requested here > SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); } > ^ > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19: > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16: > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void leave() { gnLeaveCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:55:20: note: in instantiation of member function 'CrashZone::leave' requested here > ~CrashZone() { leave(); } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: note: in instantiation of member function 'CrashZone::~CrashZone' requested here > SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); } > ^ () Change-Id: Ia63c54ed5bde6678ef6b544c1edad9600534ff05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155264 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/comphelper/crashzone.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/comphelper/crashzone.hxx b/include/comphelper/crashzone.hxx index f15f848cdf9e..c4e87e6b799c 100644 --- a/include/comphelper/crashzone.hxx +++ b/include/comphelper/crashzone.hxx @@ -55,9 +55,16 @@ public: ~CrashZone() { leave(); } static bool isInZone() { return gnEnterCount != gnLeaveCount; } static const AtomicCounter& enterCount() { return gnEnterCount; } +#if defined ARM32 && !defined __ARM_PCS_VFP && defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif // prefer creating instances to manually calling enter()/leave() static void enter() { gnEnterCount++; } static void leave() { gnLeaveCount++; } +#if defined ARM32 && !defined __ARM_PCS_VFP && defined __clang__ +#pragma clang diagnostic pop +#endif // these should be implemented for each specific zone if needed // static void hardDisable(); // static const CrashWatchdogTimingsValues& getCrashWatchdogTimingsValues();