test-fpi-device: Only push pragma -wdanging-pointer in newer GCC versions

It may not be supported and warn otherwise
This commit is contained in:
Marco Trevisan (Treviño)
2023-03-15 15:07:00 +01:00
committed by Marco Trevisan
parent 5e98f10011
commit b6223a9d0a

View File

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