Open
Description
The glm_vec3_isnan, glm_vec3_isinf, glm_vec4_isnan and glm_vec4_isinf sunctions cause compiler warnings with recent clang versions and the -ffast-math compiler flag:
"use of NaN is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled]"
or
"use of infinity is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled]"
Changes similar to the following would work around this.
@@ -172,7 +172,12 @@ glm_vec3_min(vec3 v) {
CGLM_INLINE
bool
glm_vec3_isnan(vec3 v) {
+#if !defined( FAST_MATH)
return isnan(v[0]) || isnan(v[1]) || isnan(v[2]);
+#else
- (void)v;
- return 0;
+#endif
}
/*!