From 04179380116d6e1efcf95a70f0d79b8e095b69c6 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 12 Aug 2020 02:19:06 +0430 Subject: [PATCH] [fuzzer] Mark alloc_state as unused It is really unused when failing-alloc isn't on. --- test/fuzzing/hb-fuzzer.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/fuzzing/hb-fuzzer.hh b/test/fuzzing/hb-fuzzer.hh index ca42c6839..edf049231 100644 --- a/test/fuzzing/hb-fuzzer.hh +++ b/test/fuzzing/hb-fuzzer.hh @@ -3,10 +3,16 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); +#if defined(__GNUC__) && (__GNUC__ >= 4) || (__clang__) +#define HB_UNUSED __attribute__((unused)) +#else +#define HB_UNUSED +#endif + #ifdef HB_IS_IN_FUZZER /* See src/failing-alloc.c */ extern "C" int alloc_state; #else /* Just a dummy global variable */ -static int alloc_state = 0; +static int HB_UNUSED alloc_state = 0; #endif