compiler: set minimum compiler version to GCC 4.1.0
authorSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 21 Mar 2018 22:35:21 +0000 (22:35 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Thu, 22 Mar 2018 16:38:22 +0000 (16:38 +0000)
fio hasn't compiled under GCC 3 for a while due to unguarded calls to
GCC's __sync intrinsics in critical paths. Since those intrinsics didn't
come along until GCC 4.1.0 change fio to explicitly error out on older
compilers.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
compiler/compiler-gcc3.h [deleted file]
compiler/compiler.h

diff --git a/compiler/compiler-gcc3.h b/compiler/compiler-gcc3.h
deleted file mode 100644 (file)
index 566987a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef FIO_COMPILER_GCC3_H
-#define FIO_COMPILER_GCC3_H
-
-#if __GNUC_MINOR__ >= 4
-#ifndef __must_check
-#define __must_check           __attribute__((warn_unused_result))
-#endif
-#endif
-
-#endif
index 4d92ac4949c4a5111df6ae5ba0fd36325281be49..dacb737910c0f890de63bb5b4b3030d6fa1311fc 100644 (file)
@@ -2,12 +2,10 @@
 #define FIO_COMPILER_H
 
 /* IWYU pragma: begin_exports */
-#if __GNUC__ >= 4
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
 #include "compiler-gcc4.h"
-#elif __GNUC__ == 3
-#include "compiler-gcc3.h"
 #else
-#error Compiler too old, need gcc at least gcc 3.x
+#error Compiler too old, need at least gcc 4.1.0
 #endif
 /* IWYU pragma: end_exports */