From 81af911bb0329bcd9b0f428a7940317544462d8b Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 21 Aug 2024 15:59:26 +0200 Subject: [PATCH] Remove pragmas for incompatible-pointer-type warnings The functions are now all wrapped so this should be fine now. Related to #440. --- lib/zip_source_file_win32.h | 11 ----------- lib/zip_source_file_win32_ansi.c | 4 ---- lib/zip_source_file_win32_utf16.c | 4 ---- 3 files changed, 19 deletions(-) diff --git a/lib/zip_source_file_win32.h b/lib/zip_source_file_win32.h index 86ef2651c..f01232677 100644 --- a/lib/zip_source_file_win32.h +++ b/lib/zip_source_file_win32.h @@ -73,15 +73,4 @@ zip_int64_t _zip_win32_op_tell(zip_source_file_context_t *ctx, void *f); bool _zip_filetime_to_time_t(FILETIME ft, time_t *t); int _zip_win32_error_to_errno(DWORD win32err); -#ifdef __clang__ -#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wincompatible-function-pointer-types\"") -#define DONT_WARN_INCOMPATIBLE_FN_PTR_END _Pragma("GCC diagnostic pop") -#elif defined(__GNUC__) && __GNUC__ > 13 -#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wincompatible-pointer-types\"") -#define DONT_WARN_INCOMPATIBLE_FN_PTR_END _Pragma("GCC diagnostic pop") -#else -#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN -#define DONT_WARN_INCOMPATIBLE_FN_PTR_END -#endif - #endif /* _HAD_ZIP_SOURCE_FILE_WIN32_H */ diff --git a/lib/zip_source_file_win32_ansi.c b/lib/zip_source_file_win32_ansi.c index b9a744fdf..dce75cd9a 100644 --- a/lib/zip_source_file_win32_ansi.c +++ b/lib/zip_source_file_win32_ansi.c @@ -43,8 +43,6 @@ static BOOL __stdcall ansi_move_file(const void *from, const void *to, DWORD fla static BOOL __stdcall ansi_set_file_attributes(const void *name, DWORD attributes); /* clang-format off */ -DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN - zip_win32_file_operations_t ops_ansi = { ansi_allocate_tempname, ansi_create_file, @@ -56,8 +54,6 @@ zip_win32_file_operations_t ops_ansi = { ansi_set_file_attributes, strdup }; - -DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ ZIP_EXTERN zip_source_t * diff --git a/lib/zip_source_file_win32_utf16.c b/lib/zip_source_file_win32_utf16.c index e37d65c10..01767a13f 100644 --- a/lib/zip_source_file_win32_utf16.c +++ b/lib/zip_source_file_win32_utf16.c @@ -45,8 +45,6 @@ static char *utf16_strdup(const char *string); /* clang-format off */ -DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN - zip_win32_file_operations_t ops_utf16 = { utf16_allocate_tempname, utf16_create_file, @@ -58,8 +56,6 @@ zip_win32_file_operations_t ops_utf16 = { utf16_set_file_attributes, utf16_strdup }; - -DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ ZIP_EXTERN zip_source_t *