From a470b0b20545229a51209e470692f1ad607bd17e Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 4 Jul 2020 23:56:10 +0430 Subject: [PATCH] Minor, disable strict-aliasing warning in set fuzzer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../test/fuzzing/hb-set-fuzzer.cc: In function ‘int LLVMFuzzerTestOneInput(const uint8_t*, size_t)’: ../test/fuzzing/hb-set-fuzzer.cc:38:82: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 38 | const instructions_t &instructions = reinterpret_cast (data); | And it is already disabled at project level so let's disable it here also. --- test/fuzzing/hb-set-fuzzer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/fuzzing/hb-set-fuzzer.cc b/test/fuzzing/hb-set-fuzzer.cc index d5e5d0e6f..acfe074d6 100644 --- a/test/fuzzing/hb-set-fuzzer.cc +++ b/test/fuzzing/hb-set-fuzzer.cc @@ -35,7 +35,10 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) if (size < sizeof (instructions_t)) return 0; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" const instructions_t &instructions = reinterpret_cast (data); +#pragma GCC diagnostic pop data += sizeof (instructions_t); size -= sizeof (instructions_t);