Skip to content

Commit

Permalink
Remove pragmas for incompatible-pointer-type warnings
Browse files Browse the repository at this point in the history
The functions are now all wrapped so this should be fine now.

Related to #440.
  • Loading branch information
0-wiz-0 committed Aug 21, 2024
1 parent 0afe939 commit 81af911
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
11 changes: 0 additions & 11 deletions lib/zip_source_file_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 0 additions & 4 deletions lib/zip_source_file_win32_ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 *
Expand Down
4 changes: 0 additions & 4 deletions lib/zip_source_file_win32_utf16.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 *
Expand Down

0 comments on commit 81af911

Please sign in to comment.