From 9955a70c7483c4bd46c21288161c747b3798ced5 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 28 Sep 2025 15:31:31 +0800 Subject: [PATCH] fix compat warning --- CMakeLists.txt | 3 ++- src/public/GlobalSetup.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d92008e1..ffb03f22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,10 @@ else() add_definitions(-DNDEBUG) endif() - # disable -Wshorten-64-to-32 for apple if(APPLE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-to-int-cast") endif() if(PK_ENABLE_DETERMINISM) diff --git a/src/public/GlobalSetup.c b/src/public/GlobalSetup.c index 60486556..ea09569a 100644 --- a/src/public/GlobalSetup.c +++ b/src/public/GlobalSetup.c @@ -29,8 +29,8 @@ void py_initialize() { bool is_little_endian = *(char*)&x == 1; if(!is_little_endian) c11__abort("is_little_endian != true"); - static_assert(sizeof(py_TValue) == 24, "sizeof(py_TValue) != 24"); - static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4"); + _Static_assert(sizeof(py_TValue) == 24, "sizeof(py_TValue) != 24"); + _Static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4"); pk_current_vm = pk_all_vm[0] = &pk_default_vm;