summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-30 04:41:33 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-30 19:34:32 +0300
commit205ed1edc60277c6ae8cc4383ab24535b36f7761 (patch)
treeead2580789153a2e8c62fa0923b2cc4642a5d900
parent3273c8ff0ce9999179b541ee88f210e75cbc0c18 (diff)
downloadmv-205ed1edc60277c6ae8cc4383ab24535b36f7761.tar.gz
mv-205ed1edc60277c6ae8cc4383ab24535b36f7761.tar.bz2
mv-205ed1edc60277c6ae8cc4383ab24535b36f7761.tar.xz
mv-205ed1edc60277c6ae8cc4383ab24535b36f7761.zip
Add some new flags for gcc snapshot and fix new warning.
-rw-r--r--src/localconsts.h7
-rw-r--r--src/resources/mapreader.cpp1
-rwxr-xr-xtools/ci/flags/gccsnapshot.sh3
3 files changed, 11 insertions, 0 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 08f2efe40..3ae1c74e6 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -163,12 +163,19 @@
#endif // ENABLE_CILKPLUS
#ifdef ADVGCC
+
#define const2 const
#if GCC_VERSION >= 60000
#define PRAGMA6(str) _Pragma(#str)
#else // GCC_VERSION > 60000
#define PRAGMA6(str)
#endif // GCC_VERSION > 60000
+#if GCC_VERSION >= 70000
+#define A_FALLTHROUGH __attribute__ ((fallthrough));
+#else // GCC_VERSION > 70000
+#define A_FALLTHROUGH
+#endif // GCC_VERSION > 70000
+
#else // ADVGCC
#define const2
#define PRAGMA6(str)
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index c4134e106..1427493ea 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -154,6 +154,7 @@ int inflateMemory(unsigned char *restrict const in,
{
case Z_NEED_DICT:
ret = Z_DATA_ERROR;
+ A_FALLTHROUGH
case Z_DATA_ERROR:
case Z_MEM_ERROR:
(void) inflateEnd(&strm);
diff --git a/tools/ci/flags/gccsnapshot.sh b/tools/ci/flags/gccsnapshot.sh
index 7c6542d50..198e7cf97 100755
--- a/tools/ci/flags/gccsnapshot.sh
+++ b/tools/ci/flags/gccsnapshot.sh
@@ -14,6 +14,7 @@ export CXXFLAGS="${CXXFLAGS} -Waggressive-loop-optimizations"
# not for C++
#export CXXFLAGS="${CXXFLAGS} -Waliasing"
#export CXXFLAGS="${CXXFLAGS} -Walign-commons"
+export CXXFLAGS="${CXXFLAGS} -Waligned-new=all"
export CXXFLAGS="${CXXFLAGS} -Wall"
# not for C++
#export CXXFLAGS="${CXXFLAGS} -Wampersand"
@@ -88,6 +89,7 @@ export CXXFLAGS="${CXXFLAGS} -Wextra"
export CXXFLAGS="${CXXFLAGS} -Wformat"
export CXXFLAGS="${CXXFLAGS} -Wformat-contains-nul"
export CXXFLAGS="${CXXFLAGS} -Wformat-extra-args"
+export CXXFLAGS="${CXXFLAGS} -Wformat-length=2"
# +++ ignoring. probably need use some times
#export CXXFLAGS="${CXXFLAGS} -Wformat-nonliteral"
export CXXFLAGS="${CXXFLAGS} -Wformat-security"
@@ -116,6 +118,7 @@ export CXXFLAGS="${CXXFLAGS} -Winit-self"
#export CXXFLAGS="${CXXFLAGS} -Winline"
# not for C++
#export CXXFLAGS="${CXXFLAGS} -Wint-conversion"
+export CXXFLAGS="${CXXFLAGS} -Wint-in-bool-context"
export CXXFLAGS="${CXXFLAGS} -Wint-to-pointer-cast"
# not for C++
#export CXXFLAGS="${CXXFLAGS} -Winteger-division"