source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Narrowing error during compilation with GCC 6

Open kiroma opened this issue 8 years ago • 2 comments

For some reason, in following line: static ALIGN16 int32 signmask[4]={0x80000000,0x80000000,0x80000000,0x80000000}; (located in src/raytrace/trace2.cpp at line 45) 0x80000000 is converted by compiler to 2147483648u, which throws a narrowing error. There are also several more locations where this error occurs, is there any workaround for this, or am I doing something wrong? I tried to follow this guide.

kiroma avatar Feb 04 '17 11:02 kiroma

The current SDK release targets GCC 4.8. A future SDK update will fix GCC 6 / Clang 3.9 compilation out of the box. Until then you may need to make some tweaks or try with -Wno-narrowing to get things working.

Nephyrin avatar Feb 06 '17 18:02 Nephyrin

It'd be nice to have that future sdk update for sure.

CarePackage17 avatar Jun 06 '21 17:06 CarePackage17