PhysX icon indicating copy to clipboard operation
PhysX copied to clipboard

Compilation errors and warnings (gcc 10.1) . nonnull, restrict and class-memaccess

Open phcerdan opened this issue 4 years ago • 4 comments

PhysX/src/physx/../pxshared/include/foundation/unix/PxUnixIntrinsics.h:162:15: error: argument 1 null where non-null expected [-Werror=nonnull]
PhysX/src/physx/source/geomutils/src/mesh/GuBV4Build.cpp:298:24: error: passing argument 1 to ‘restrict’-qualified parameter aliases with argument 5 [-Werror=restrict]

Both can be silenced with: `-Wno-error=nonnull -Wno-error=restrict

Another:

PhysX/src/physx/source/lowleveldynamics/include/DyFeatherstoneArticulationUtils.h:53:70: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct physx::Cm::UnAlignedSpatialVector’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]

phcerdan avatar Aug 08 '20 09:08 phcerdan

I can't get rid of treating the warning as an error. Can anyone help?

Screenshot from 2022-06-12 02-41-20

For example, I tried to get rid of the error by "resetting" compiler flags: set(CMAKE_CXX_FLAGS "") message(INFO ${PHYSX_PATH}) add_subdirectory(${PHYSX_PATH}/compiler/public externals/physx) target_link_libraries(${PROJECT_NAME} ${PHYSX_LIBRARIES})

damian-tomczak avatar Jun 12 '22 00:06 damian-tomczak

Why "resetting" would solve this problem? Try:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=nonnull -Wno-error=restrict")

phcerdan avatar Jun 12 '22 07:06 phcerdan

Unfortunately it did not help: Screenshot from 2022-06-12 10-42-36

damian-tomczak avatar Jun 12 '22 08:06 damian-tomczak

This doesn't help either:

string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-Werror=class-memaccess" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_subdirectory(${PHYSX_PATH}/compiler/public externals/physx)
string(REPLACE "-Werror=class-memaccess" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

damian-tomczak avatar Jun 12 '22 10:06 damian-tomczak