From ac2cf2f71b58c2a0d0fe697de1ec74b5928a20ac Mon Sep 17 00:00:00 2001 From: Abdelhadi Date: Thu, 29 Jun 2023 10:02:39 +0300 Subject: [PATCH 1/2] Fix: disabled dangling-reference warning in gcc13 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46c2a591c..224f6e48f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,6 +268,11 @@ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW) SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_POSITION_INDEPENDENT_CODE ON) ENDIF() + + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13) + MESSAGE(STATUS "GCC13 detected disabling \"-Wdangling-reference\" in Cpp files as it appears to be a false positive") + ADD_COMPILE_OPTIONS("$<$:-Wno-dangling-reference>") + ENDIF() # hide all not-exported symbols IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" ) SET(CMAKE_CXX_FLAGS "-mxgot -fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") From d1edaa949bbf55b520fbc7e749293423f507eb8a Mon Sep 17 00:00:00 2001 From: Marco Feuerstein Date: Thu, 29 Jun 2023 14:51:16 +0200 Subject: [PATCH 2/2] Fix passing of file extension string. Previously only the first letter of the string was passed to c, now it passes the whole extension. --- port/PyAssimp/pyassimp/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index edde8b29a..f891b5d40 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -311,6 +311,7 @@ def load(filename, Scene object with model data ''' + from ctypes import c_char_p if hasattr(filename, 'read'): # This is the case where a file object has been passed to load. # It is calling the following function: @@ -324,7 +325,7 @@ def load(filename, model = _assimp_lib.load_mem(data, len(data), processing, - file_type) + c_char_p(file_type.encode(sys.getfilesystemencoding()))) else: # a filename string has been passed model = _assimp_lib.load(filename.encode(sys.getfilesystemencoding()), processing)