star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit d594c241dbb4a06ebf505da82ae602985e33cf7d
parent e872fee12fc8664c6b37b41b777867aed5334146
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 21 Mar 2023 11:35:15 +0100

Disable an Embree4 build warning

When included, the Embree4 rtcore_common.h header causes a compile-time
warning due to an enumerator value that exceeds the range of an int.
Note that this warning is silently disabled if this header is in a
directory defined by the '-isystem' option in gcc. And this is what
CMake does when the pkgconfig file uses the -I option rather than
-isystem. This is why this warning was not visible when using CMake.

Diffstat:
Msrc/s3d_backend.h | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/s3d_backend.h b/src/s3d_backend.h @@ -33,18 +33,25 @@ #ifndef S3D_BACKEND_H #define S3D_BACKEND_H -#include <rsys/rsys.h> /* COMPILER_CL */ +#include <rsys/rsys.h> /* COMPILER_<CL|GCC> */ #ifdef COMPILER_CL /* Structure was padded due to alignment specifier */ #pragma warning(push) #pragma warning(disable: 4324) +#elif defined COMPILER_GCC + /* Disable the "ISO C restricts enumerator values to range of 'int'" compiler + * warning in rtcore_common.h, line 293 (RTC_FEATURE_FLAG_ALL = 0xffffffff) */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpedantic" #endif #include <embree4/rtcore.h> #ifdef COMPILER_CL #pragma warning(pop) +#elif defined COMPILER_GCC + #pragma GCC diagnostic pop #endif #endif /* S3D_BACKEND_H */