From b63cb90b65a94378dc87ad2d77f8c75a68a0b919 Mon Sep 17 00:00:00 2001 From: xia__mc <2052472631@qq.com> Date: Wed, 13 Nov 2024 17:52:47 +0800 Subject: [PATCH] Remove -Werror, I only ensure it can be no warnings on msvc Fix Unsafe.set buggy --- pyfastutil/src/ints/IntArrayList.h | 1 - pyfastutil/src/unsafe/Unsafe.cpp | 2 +- pyfastutil/src/unsafe/Unsafe.h | 1 - setup.py | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyfastutil/src/ints/IntArrayList.h b/pyfastutil/src/ints/IntArrayList.h index ec74754..8d61de2 100644 --- a/pyfastutil/src/ints/IntArrayList.h +++ b/pyfastutil/src/ints/IntArrayList.h @@ -6,7 +6,6 @@ #define PYFASTUTIL_INTARRAYLIST_H #include "utils/PythonPCH.h" -#include "Compat.h" PyMODINIT_FUNC PyInit_IntArrayList(); diff --git a/pyfastutil/src/unsafe/Unsafe.cpp b/pyfastutil/src/unsafe/Unsafe.cpp index 018e38b..bcbcbd6 100644 --- a/pyfastutil/src/unsafe/Unsafe.cpp +++ b/pyfastutil/src/unsafe/Unsafe.cpp @@ -116,7 +116,7 @@ static PyObject *Unsafe_set([[maybe_unused]] PyObject *self, PyObject *args) { } const Py_ssize_t pySize = PyBytes_Size(pyBytes); - if (pySize == -1 || pySize > static_cast(SIZE_MAX)) { + if (pySize == -1 || pySize > SIZE_MAX) { PyErr_SetString(PyExc_TypeError, "Invalid bytes."); return nullptr; } diff --git a/pyfastutil/src/unsafe/Unsafe.h b/pyfastutil/src/unsafe/Unsafe.h index 0e1c99d..f66a473 100644 --- a/pyfastutil/src/unsafe/Unsafe.h +++ b/pyfastutil/src/unsafe/Unsafe.h @@ -6,7 +6,6 @@ #define PYFASTUTIL_UNSAFE_H #include "utils/PythonPCH.h" -#include "Compat.h" PyMODINIT_FUNC PyInit_Unsafe(); diff --git a/setup.py b/setup.py index 939b49f..8cc6ab5 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # Unix-like uses GCC/Clang EXTRA_COMPILE_ARG = [ "-O3", "-funroll-loops", "-flto", "-fPIC", - "-std=c++2b", "-Wall", "-Werror", "-fvisibility=hidden", + "-std=c++2b", "-Wall", "-fvisibility=hidden", "-Wno-error=unknown-pragmas", "-Wno-error=unguarded-availability-new" # already handle in Compat.h ]