Merge pull request #60663 from Geometror/fix-fnlite-gcc-warning

This commit is contained in:
Rémi Verschelde 2022-05-03 11:21:20 +02:00 committed by GitHub
commit bf8da10651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View file

@ -1611,6 +1611,12 @@ private:
}
}
// GCC raises warnings when integer overflows occur, which are needed for hashing here.
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
#endif
template <typename FNfloat>
float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const
{
@ -1765,6 +1771,9 @@ private:
}
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
// Perlin Noise

View file

@ -430,3 +430,26 @@
{
x *= frequency;
y *= frequency;
@@ -1611,6 +1611,12 @@ private:
}
}
+// GCC raises warnings when integer overflows occur, which are needed for hashing here.
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
+#endif
+
template <typename FNfloat>
float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const
{
@@ -1765,6 +1771,9 @@ private:
}
}
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
// Perlin Noise