summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIban Eguia <razican@protonmail.ch>2017-12-01 02:40:00 +0100
committerAlon Zakai <alonzakai@gmail.com>2017-11-30 17:40:00 -0800
commite91d1bf256d70d0e1635dcf35a3d253d11555f58 (patch)
tree64c886bfcf0079c00fdce157d7c94562e92bf8ed /src
parentbcc6205e83ec98f9b3d5704b79255a853a4ee8bd (diff)
downloadbinaryen-e91d1bf256d70d0e1635dcf35a3d253d11555f58.tar.gz
binaryen-e91d1bf256d70d0e1635dcf35a3d253d11555f58.tar.bz2
binaryen-e91d1bf256d70d0e1635dcf35a3d253d11555f58.zip
Fixed compilation in GCC 7 (#1301)
Diffstat (limited to 'src')
-rw-r--r--src/tools/fuzzing.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index d9acadbd1..982a94114 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -671,7 +671,7 @@ private:
hangStack.push_back(nullptr);
condition = makeCondition();
}
- // we need to find a proper target to break to; try a few times
+ // we need to find a proper target to break to; try a few times
int tries = TRIES;
while (tries-- > 0) {
auto* target = vectorPick(breakableStack);
@@ -1352,12 +1352,26 @@ private:
return first;
}
+ // Trick to avoid a bug in GCC 7.x.
+ // Upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82800
+ #define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+ #if GCC_VERSION > 70000 && GCC_VERSION < 70300
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+ #endif
+
template<typename T, typename... Args>
T pickGivenNum(size_t num, T first, Args... args) {
if (num == 0) return first;
return pickGivenNum<T>(num - 1, args...);
}
+ #if GCC_VERSION > 70000 && GCC_VERSION < 70300
+ #pragma GCC diagnostic pop
+ #endif
+
// utilities
Name getTargetName(Expression* target) {