diff options
author | Benjamin Berg <bberg@redhat.com> | 2022-02-14 17:47:33 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2022-02-14 17:57:59 +0100 |
commit | 5fb3b8b43a2b7a2a86b583d87e6db70218c8bbea (patch) | |
tree | 8207c419bcc717fa6903c2d5a309923cabd34929 | |
parent | 8fad2652ee75836e5a60c73af0f06cc8b57a07f5 (diff) |
tests: Avoid -Wdangling-pointer warning
The code is correct, but gcc thinks the pointer is still NULL after the
call. As obvious workaround don't seem to work, just disable the warning
for now.
-rw-r--r-- | tests/test-fpi-device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c index ff658e9..f1c4275 100644 --- a/tests/test-fpi-device.c +++ b/tests/test-fpi-device.c @@ -29,6 +29,10 @@ #include "test-device-fake.h" #include "fp-print-private.h" +/* gcc 12.0.1 is complaining about dangling pointers in the auto_close* functions */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-pointer" + /* Utility functions */ typedef FpDevice FpAutoCloseDevice; @@ -65,6 +69,8 @@ auto_close_fake_device_free (FpAutoCloseDevice *device) } G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpAutoCloseDevice, auto_close_fake_device_free) +#pragma GCC diagnostic pop + typedef FpDeviceClass FpAutoResetClass; static FpAutoResetClass default_fake_dev_class = {0}; |