From b6223a9d0a26542adecac785f656f1ccc0b66852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 15 Mar 2023 15:07:00 +0100 Subject: [PATCH] test-fpi-device: Only push pragma -wdanging-pointer in newer GCC versions It may not be supported and warn otherwise --- tests/test-fpi-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c index f778eaa8..33013bc7 100644 --- a/tests/test-fpi-device.c +++ b/tests/test-fpi-device.c @@ -30,8 +30,10 @@ #include "fp-print-private.h" /* gcc 12.0.1 is complaining about dangling pointers in the auto_close* functions */ +#if G_GNUC_CHECK_VERSION (12, 0) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif /* Utility functions */ @@ -69,7 +71,9 @@ auto_close_fake_device_free (FpAutoCloseDevice *device) } G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpAutoCloseDevice, auto_close_fake_device_free) +#if G_GNUC_CHECK_VERSION (12, 0) #pragma GCC diagnostic pop +#endif typedef FpDeviceClass FpAutoResetClass; static FpAutoResetClass default_fake_dev_class = {0};