Gmod-vphysics icon indicating copy to clipboard operation
Gmod-vphysics copied to clipboard

Build is broken

Open Hi-Angel opened this issue 8 years ago • 1 comments

As of gcc-6.3, build stops with the error on this line

In file included from ../../src/vectormath/sse/vectormath_aos.h:2543:0,
				 from ../../src/vectormath/vmInclude.h:11,
				 from ../../src/BulletMultiThreaded/PlatformDefinitions.h:16,
				 from ../../src/BulletMultiThreaded/Win32Threading.cpp:1:
../../src/vectormath/sse/vec_aos.h: In member function ‘const Vectormath::Aos::Vector3 Vectormath::Aos::Vector3::operator-() const’:
../../src/vectormath/sse/vec_aos.h:580:97: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
  VM_ATTRIBUTE_ALIGN16 static const int array[] = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
																								 ^
../../src/vectormath/sse/vec_aos.h:580:97: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
../../src/vectormath/sse/vec_aos.h:580:97: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
../../src/vectormath/sse/vec_aos.h:580:97: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
In file included from ../../src/vectormath/vmInclude.h:11:0,
				 from ../../src/BulletMultiThreaded/PlatformDefinitions.h:16,
				 from ../../src/BulletMultiThreaded/Win32Threading.cpp:1:
../../src/vectormath/sse/vectormath_aos.h: At global scope:
../../src/vectormath/sse/vectormath_aos.h:695:39: warning: inline function ‘const Vectormath::Aos::Vector3 Vectormath::Aos::select(const Vectormath::Aos::Vector3&, const Vectormath::Aos::Vector3&, const Vectormath::boolInVec&)’ used but never defined
 VECTORMATH_FORCE_INLINE const Vector3 select( const Vector3 &vec0, const Vector3 &vec1, const boolInVec &select1 );
									   ^~~~~~
In file included from ../../src/vectormath/vmInclude.h:11:0,
				 from ../../src/BulletMultiThreaded/PlatformDefinitions.h:16,
				 from ../../src/BulletMultiThreaded/Win32Threading.cpp:1:
../../src/vectormath/sse/vectormath_aos.h:1648:36: warning: inline function ‘const Vectormath::Aos::Quat Vectormath::Aos::select(const Vectormath::Aos::Quat&, const Vectormath::Aos::Quat&, const Vectormath::boolInVec&)’ used but never defined
 VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1, const boolInVec &select1 );
									^~~~~~
make[1]: *** [BulletMultiThreaded.make:135: obj/Release/BulletMultiThreaded/Win32Threading.o] Error 1
make: *** [Makefile:25: BulletMultiThreaded] Error 2
 + Linking...
 + Module created at ../build/bin/linux/release/vphysics_srv.so

I tried to fix this, and from my research the code there should be

VM_ATTRIBUTE_ALIGN16 static const unsigned short array[] = {0x8000, 0x8000, 0x8000, 0x8000};

Unfortunately it didn't fix the problem, and I've no idea what else is in there that I didn't see. Sorry.

Hi-Angel avatar Jan 28 '17 16:01 Hi-Angel

Hi, I realize that this is an old issue, but this simple fix silences the error: VM_ATTRIBUTE_ALIGN16 static const int array[] = {static_cast<int>(0x80000000), static_cast<int>(0x80000000), static_cast<int>(0x80000000), static_cast<int>(0x80000000)};

melvyn2 avatar Oct 07 '20 05:10 melvyn2