@@ -3217,15 +3217,18 @@ struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT) InternalData
3217
3217
__hostdev__ const StatsT& average () const { return mAverage ; }
3218
3218
__hostdev__ const StatsT& stdDeviation () const { return mStdDevi ; }
3219
3219
3220
- #if defined(__GNUC__) && !defined(__APPLE__) && !defined(__llvm__)
3220
+ // GCC 11 (and possibly prior versions) has a regression that results in invalid
3221
+ // warnings when -Wstringop-overflow is turned on. For details, refer to
3222
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854
3223
+ #if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3221
3224
#pragma GCC diagnostic push
3222
3225
#pragma GCC diagnostic ignored "-Wstringop-overflow"
3223
3226
#endif
3224
3227
__hostdev__ void setMin (const ValueT& v) { mMinimum = v; }
3225
3228
__hostdev__ void setMax (const ValueT& v) { mMaximum = v; }
3226
3229
__hostdev__ void setAvg (const StatsT& v) { mAverage = v; }
3227
3230
__hostdev__ void setDev (const StatsT& v) { mStdDevi = v; }
3228
- #if defined(__GNUC__) && !defined(__APPLE__) && !defined(__llvm__)
3231
+ #if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3229
3232
#pragma GCC diagnostic pop
3230
3233
#endif
3231
3234
@@ -3662,10 +3665,20 @@ struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT) LeafData
3662
3665
__hostdev__ FloatType getAvg () const { return mAverage ; }
3663
3666
__hostdev__ FloatType getDev () const { return mStdDevi ; }
3664
3667
3668
+ // GCC 11 (and possibly prior versions) has a regression that results in invalid
3669
+ // warnings when -Wstringop-overflow is turned on. For details, refer to
3670
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854
3671
+ #if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3672
+ #pragma GCC diagnostic push
3673
+ #pragma GCC diagnostic ignored "-Wstringop-overflow"
3674
+ #endif
3665
3675
__hostdev__ void setMin (const ValueType& v) { mMinimum = v; }
3666
3676
__hostdev__ void setMax (const ValueType& v) { mMaximum = v; }
3667
3677
__hostdev__ void setAvg (const FloatType& v) { mAverage = v; }
3668
3678
__hostdev__ void setDev (const FloatType& v) { mStdDevi = v; }
3679
+ #if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3680
+ #pragma GCC diagnostic pop
3681
+ #endif
3669
3682
3670
3683
template <typename T>
3671
3684
__hostdev__ void setOrigin (const T& ijk) { mBBoxMin = ijk; }
0 commit comments