]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix a bunch of harmless compiler warnings on recent GCC releases.
authorPeter Powell <petpow@saberuk.com>
Fri, 26 Oct 2018 00:18:54 +0000 (01:18 +0100)
committerPeter Powell <petpow@saberuk.com>
Fri, 26 Oct 2018 00:20:35 +0000 (01:20 +0100)
make/template/main.mk
src/command_parse.cpp
src/configparser.cpp
src/modules/extra/m_geoip.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/m_httpd.cpp

index a67c14f732c7dc25334cfb7eeccd9cf6f780d7ce..74b5b066c2f02ac28ab22c4b0fca99b3b5593f77 100644 (file)
@@ -55,7 +55,7 @@ INSTMODE_LIB = 0640
 ifneq ($(COMPILER), ICC)
   CORECXXFLAGS += -Woverloaded-virtual -Wshadow
 ifneq ($(SYSTEM), openbsd)
-    CORECXXFLAGS += -pedantic -Wformat=2 -Wmissing-format-attribute
+    CORECXXFLAGS += -pedantic -Wformat=2 -Wmissing-format-attribute -Wno-format-nonliteral
 endif
 endif
 
index d4dd7da214c20e894d12f159b989cb52907bd0a6..c2ae39d494e3a75579d4635f36f62394d5c95671 100644 (file)
@@ -452,7 +452,7 @@ void CommandParser::TranslateSingleParam(TranslateType to, const std::string& it
                        }
                        // If no custom translator was given, fall through
                }
-               case TR_TEXT:
+               /*@fallthrough@*/
                default:
                        /* Do nothing */
                        dest.append(item);
index 8250530443c7b38c96aadd93336c21929f8910a5..437b3cdb0c3822a8ad8691d3f50db8b14ce68f51 100644 (file)
@@ -286,7 +286,8 @@ struct Parser
                                                break;
                                        case 0xFE:
                                        case 0xFF:
-                                               stack.errstr << "Do not save your files as UTF-16; use ASCII!\n";
+                                               stack.errstr << "Do not save your files as UTF-16 or UTF-32, use UTF-8!\n";
+                                               /*@fallthrough@*/
                                        default:
                                                throw CoreException("Syntax error - start of tag expected");
                                }
index 6272a5c2493cf231313b4154835a4f3692efad45..e4299a1c20c5e8a50fd26308a8a9be980ed3b54a 100644 (file)
 #if defined __clang__
 # pragma clang diagnostic ignored "-Wc++11-extensions"
 #elif defined __GNUC__
-# pragma GCC diagnostic ignored "-pedantic"
+# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))
+#  pragma GCC diagnostic ignored "-Wpedantic"
+# else
+#  pragma GCC diagnostic ignored "-pedantic"
+# endif
 #endif
 
 #include <GeoIP.h>
index 8bd73b2bb6f824e3e00f266a4149fe50ea827e1c..f5711cbd740faf28e7fb55ca2e36662e0f11c2d0 100644 (file)
@@ -41,7 +41,9 @@
 #if defined __clang__
 # pragma clang diagnostic ignored "-Wc++11-extensions"
 #elif defined __GNUC__
-# if __GNUC__ < 6
+# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))
+#  pragma GCC diagnostic ignored "-Wpedantic"
+# else
 #  pragma GCC diagnostic ignored "-pedantic"
 # endif
 #endif
index f67f4cb81464a18779745cb3e47bef523e213101..3a0d4f86102fffc121d29624c37344456b251ed3 100644 (file)
 #if defined __clang__
 # pragma clang diagnostic ignored "-Wc++11-extensions"
 #elif defined __GNUC__
-# pragma GCC diagnostic ignored "-pedantic"
+# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))
+#  pragma GCC diagnostic ignored "-Wpedantic"
+# else
+#  pragma GCC diagnostic ignored "-pedantic"
+# endif
 #endif
 
 // Fix warnings about shadowing in http_parser.