summaryrefslogtreecommitdiff
path: root/src/common/cbasetypes.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-30 18:21:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-30 20:37:26 +0300
commit2000a698da35915afb1a598433337a735d27ae24 (patch)
tree119c8d409657cee1d90cd0c072ef3b7e846fa3f0 /src/common/cbasetypes.h
parent84ecefb4db23bbd98194a43a592cfe313477a1ab (diff)
downloadhercules-2000a698da35915afb1a598433337a735d27ae24.tar.gz
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.bz2
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.xz
hercules-2000a698da35915afb1a598433337a735d27ae24.zip
Add different fixes for gcc 7 warnings.
Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings.
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r--src/common/cbasetypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index d3db86543..33d617b13 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -298,6 +298,13 @@ typedef uintptr_t uintptr;
#define PRAGMA_GCC45(str)
#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
+// fallthrough attribute only enabled on gcc >= 7.0
+#if defined(__GNUC__) && (GCC_VERSION >= 70000)
+#define FALLTHROUGH __attribute__ ((fallthrough));
+#else // ! defined(__GNUC__) && (GCC_VERSION >= 70000)
+#define FALLTHROUGH
+#endif // ! defined(__GNUC__) && (GCC_VERSION >= 70000)
+
// boolean types for C
#if !defined(_MSC_VER) || _MSC_VER >= 1800
// MSVC doesn't have stdbool.h yet as of Visual Studio 2012 (MSVC version 17.00)