aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2023-12-08 22:52:08 +0100
committerTormod Volden <debian.tormod@gmail.com>2023-12-09 09:06:41 +0100
commit56cee16efd9ff9d1b4b976e128bf05162bd0c85f (patch)
tree26b197a0882337affcd6ff4ac2a9ac3a65ff5d03
parentdac541dc75370cf7b6051cc6c163af1f468b19ed (diff)
downloadlibusb-56cee16efd9ff9d1b4b976e128bf05162bd0c85f.tar.gz
tests/umockdev: Avoid unknown warning option on older gcc
According to https://gcc.gnu.org/wiki/StaticAnalyzer the -Wanalyzer-malloc-leak and -Wanalyzer-file-leak options came in GCC 10. When building with GCC 9 there would be warnings: CC umockdev-umockdev.o ../../libusb-git/tests/umockdev.c:37:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas] 37 | #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" | ^~~~~~~~~~~~~~~~~~~~~~~~ ../../libusb-git/tests/umockdev.c:38:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas] 38 | #pragma GCC diagnostic ignored "-Wanalyzer-file-leak" | ^~~~~~~~~~~~~~~~~~~~~~ Closes #1369 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r--libusb/version_nano.h2
-rw-r--r--tests/umockdev.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 4c6b16d..010c8ec 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11844
+#define LIBUSB_NANO 11845
diff --git a/tests/umockdev.c b/tests/umockdev.c
index 67b7474..ec0a07b 100644
--- a/tests/umockdev.c
+++ b/tests/umockdev.c
@@ -33,7 +33,7 @@
#define UNUSED_DATA __attribute__ ((unused)) gconstpointer unused_data
/* avoid leak reports inside assertions; leaking stuff on assertion failures does not matter in tests */
-#if !defined(__clang__)
+#if !defined(__clang__) && __GNUC__ > 9
#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
#pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
#endif