From 7672c49f7ed6cc0eccc40593293efc8ec04e0cd2 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 14 Jan 2020 13:17:45 +0100 Subject: [PATCH] gcc: disable picky gcc-8 function pointer warnings --- include/common.h | 11 +++++++++++ src/Makefile | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index d4b54936d..3838cd3cb 100644 --- a/include/common.h +++ b/include/common.h @@ -95,6 +95,17 @@ but this is nededed for VS compiler which doesn't have inline keyword but has __ #define STAT_NANOSECONDS_ACCESS_TIME st_atimespec.tv_nsec #endif +/** + * Disable this picky gcc-8 compiler warning + * We're in good company: + * https://github.com/curl/curl/blob/fc3743c31bb3c84e31a2eff99e958337571eb5f0/lib/md5.c#L487-L490 + * https://github.com/kivadiu/thread/blob/ee607c86d4acd1d7733304526eb25d742b533071/src/win32/thread_primitives.cpp#L105-L113 + */ + +#if defined (__GNUC__) && (__GNUC__ >= 8) +#pragma GCC diagnostic ignored "-Wcast-function-type" +#endif + // config section // do not try to simply change this, it will not work diff --git a/src/Makefile b/src/Makefile index a922a2362..ea4eea152 100644 --- a/src/Makefile +++ b/src/Makefile @@ -169,7 +169,6 @@ ifeq ($(PRODUCTION),0) CFLAGS += -W CFLAGS += -Wall CFLAGS += -Wextra -CFLAGS += -Wno-cast-function-type endif ## because LZMA SDK