NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.11k stars 793 forks source link

ODR violations in struct RayParams #640

Closed thiagomacieira closed 1 year ago

thiagomacieira commented 1 year ago

When compiling with LTO, GCC complains:

source/scenequery/src/SqBucketPruner.cpp:1205:16: warning: type ‘struct RayParams’ violates the C++ One Definition Rule [-Wodr]
 1205 |         struct RayParams
      |                ^
source/geomutils/src/mesh/GuBV4_CapsuleSweepAA.cpp:46:16: note: a different type is defined in another translation unit
   46 |         struct RayParams
      |                ^
source/scenequery/src/SqBucketPruner.cpp:1207:17: note: the first difference of corresponding definitions is field ‘mData2’
 1207 |                 PX_ALIGN(16,    PxVec3  mData2);        float   padding0;
      |                 ^
source/geomutils/src/mesh/GuBV4_CapsuleSweepAA.cpp:48:17: note: a field with different name is defined in another translation unit
   48 |                 BV4_ALIGN16(Vec3p       mCenterOrMinCoeff_PaddedAligned);

If they can't be merged, then please rename one of the structs or place one or both of them inside an unnamed namespace.

PierreTerdiman commented 1 year ago

The structures have been moved to anonymous namespaces. The change should appear in a future release.