aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt26
-rw-r--r--capchild/CMakeLists.txt4
-rw-r--r--caputils/CMakeLists.txt4
-rw-r--r--echld/CMakeLists.txt5
-rw-r--r--epan/CMakeLists.txt4
-rw-r--r--epan/dissectors/dcerpc/CMakeLists.txt4
-rw-r--r--plugins/docsis/CMakeLists.txt4
-rw-r--r--plugins/ethercat/CMakeLists.txt4
-rw-r--r--plugins/gryphon/CMakeLists.txt4
-rw-r--r--plugins/irda/CMakeLists.txt4
-rw-r--r--plugins/m2m/CMakeLists.txt4
-rw-r--r--plugins/mate/CMakeLists.txt4
-rw-r--r--plugins/opcua/CMakeLists.txt4
-rw-r--r--plugins/profinet/CMakeLists.txt4
-rw-r--r--plugins/stats_tree/CMakeLists.txt4
-rw-r--r--plugins/tpg/CMakeLists.txt4
-rw-r--r--plugins/unistim/CMakeLists.txt4
-rw-r--r--plugins/wimax/CMakeLists.txt4
-rw-r--r--plugins/wimaxasncp/CMakeLists.txt4
-rw-r--r--plugins/wimaxmacphy/CMakeLists.txt4
-rw-r--r--tools/lemon/CMakeLists.txt4
-rw-r--r--ui/CMakeLists.txt4
-rw-r--r--ui/gtk/CMakeLists.txt4
-rw-r--r--ui/qt/CMakeLists.txt12
-rw-r--r--ui/qt/rpc_service_response_time_dialog.cpp10
-rw-r--r--ui/qt/wireshark_application.cpp10
-rw-r--r--wiretap/CMakeLists.txt4
-rw-r--r--wsutil/CMakeLists.txt4
28 files changed, 88 insertions, 67 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f234acf28..06aab57ae7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -496,12 +496,6 @@ set( CPP_FLAG_TESTS ${WIRESHARK_COMMON_FLAGS} ${WIRESHARK_CPP_ONLY_FLAGS} )
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
-if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
- check_c_compiler_flag(-Werror WERROR)
-else()
- set(WERROR FALSE)
-endif()
-
# Sigh: Have to use THIS_FLAG instead of ${F} for some reason
foreach(THIS_FLAG ${C_FLAG_TESTS})
string( REGEX REPLACE "[^a-zA-Z0-9_]+" "_" F ${THIS_FLAG} )
@@ -527,6 +521,21 @@ foreach(THIS_FLAG ${CPP_FLAG_TESTS})
endforeach()
set(CMAKE_CXX_FLAGS "${ADDED_CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
+if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
+ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
+ set(WERROR_COMMON_FLAGS "/WX")
+ set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS)
+ else()
+ check_c_compiler_flag(-Werror WERROR)
+ if (WERROR)
+ set(WERROR_COMMON_FLAGS "-Werror")
+ set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "-Wno-error=deprecated-declarations")
+ endif()
+ endif()
+else()
+ set(WERROR_COMMON_FLAGS FALSE)
+endif()
+
#
# Try to have the compiler default to hiding symbols, so that only
# symbols explicitly exported with WS_DLL_PUBLIC will be visible
@@ -915,6 +924,7 @@ endif()
message(STATUS "C-Flags: ${CMAKE_C_FLAGS}")
message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS}")
+message(STATUS "Warnings as errors: ${WERROR_COMMON_FLAGS}")
if(APPLE)
#
@@ -2418,11 +2428,11 @@ set(CLEAN_FILES
${androiddump_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/capchild/CMakeLists.txt b/capchild/CMakeLists.txt
index cc94e47d3f..64b6edeb70 100644
--- a/capchild/CMakeLists.txt
+++ b/capchild/CMakeLists.txt
@@ -29,11 +29,11 @@ set(CLEAN_FILES
${CAPCHILD_SRC}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/caputils/CMakeLists.txt b/caputils/CMakeLists.txt
index 3bf314f98a..4f6a9ef130 100644
--- a/caputils/CMakeLists.txt
+++ b/caputils/CMakeLists.txt
@@ -52,11 +52,11 @@ set(CLEAN_FILES
${CAPUTILS_SRC}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/echld/CMakeLists.txt b/echld/CMakeLists.txt
index a7e3701be4..257c301598 100644
--- a/echld/CMakeLists.txt
+++ b/echld/CMakeLists.txt
@@ -39,11 +39,11 @@ set(ECHLD_FILES
${DIRTY_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
@@ -92,4 +92,3 @@ if(NOT ${ENABLE_STATIC})
ARCHIVE DESTINATION lib
)
endif()
-
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 1d600f487b..29785efa9a 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -1725,11 +1725,11 @@ set(CLEAN_FILES
${WSLUA_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/epan/dissectors/dcerpc/CMakeLists.txt b/epan/dissectors/dcerpc/CMakeLists.txt
index ee2077ea0e..276357cb75 100644
--- a/epan/dissectors/dcerpc/CMakeLists.txt
+++ b/epan/dissectors/dcerpc/CMakeLists.txt
@@ -34,11 +34,11 @@ set(CLEAN_FILES
${IDL2WRS_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/docsis/CMakeLists.txt b/plugins/docsis/CMakeLists.txt
index ad8c04df7f..73b9ea76fb 100644
--- a/plugins/docsis/CMakeLists.txt
+++ b/plugins/docsis/CMakeLists.txt
@@ -81,11 +81,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/ethercat/CMakeLists.txt b/plugins/ethercat/CMakeLists.txt
index 8acba1d120..446885241c 100644
--- a/plugins/ethercat/CMakeLists.txt
+++ b/plugins/ethercat/CMakeLists.txt
@@ -43,11 +43,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/gryphon/CMakeLists.txt b/plugins/gryphon/CMakeLists.txt
index 78dd816207..8080548204 100644
--- a/plugins/gryphon/CMakeLists.txt
+++ b/plugins/gryphon/CMakeLists.txt
@@ -37,11 +37,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/irda/CMakeLists.txt b/plugins/irda/CMakeLists.txt
index b2575ae28c..ad10505e9d 100644
--- a/plugins/irda/CMakeLists.txt
+++ b/plugins/irda/CMakeLists.txt
@@ -39,11 +39,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/m2m/CMakeLists.txt b/plugins/m2m/CMakeLists.txt
index aa9c7b8a69..ed6c423dd4 100644
--- a/plugins/m2m/CMakeLists.txt
+++ b/plugins/m2m/CMakeLists.txt
@@ -42,11 +42,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/mate/CMakeLists.txt b/plugins/mate/CMakeLists.txt
index 9e8e54d549..666dd1b240 100644
--- a/plugins/mate/CMakeLists.txt
+++ b/plugins/mate/CMakeLists.txt
@@ -60,11 +60,11 @@ set(CLEAN_FILES
${DISSECTOR_SUPPORT_CLEAN_SRC}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/opcua/CMakeLists.txt b/plugins/opcua/CMakeLists.txt
index 685c765c88..812e92fb5a 100644
--- a/plugins/opcua/CMakeLists.txt
+++ b/plugins/opcua/CMakeLists.txt
@@ -52,11 +52,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/profinet/CMakeLists.txt b/plugins/profinet/CMakeLists.txt
index a672997329..2dc6139430 100644
--- a/plugins/profinet/CMakeLists.txt
+++ b/plugins/profinet/CMakeLists.txt
@@ -49,11 +49,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/stats_tree/CMakeLists.txt b/plugins/stats_tree/CMakeLists.txt
index 160661137b..b7a4e60a47 100644
--- a/plugins/stats_tree/CMakeLists.txt
+++ b/plugins/stats_tree/CMakeLists.txt
@@ -33,11 +33,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/tpg/CMakeLists.txt b/plugins/tpg/CMakeLists.txt
index 5e7b5bd301..61bde02392 100644
--- a/plugins/tpg/CMakeLists.txt
+++ b/plugins/tpg/CMakeLists.txt
@@ -33,11 +33,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/unistim/CMakeLists.txt b/plugins/unistim/CMakeLists.txt
index 5f700f7ec0..0725c3f4ea 100644
--- a/plugins/unistim/CMakeLists.txt
+++ b/plugins/unistim/CMakeLists.txt
@@ -37,11 +37,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/wimax/CMakeLists.txt b/plugins/wimax/CMakeLists.txt
index 73d46e88ae..77af623ba9 100644
--- a/plugins/wimax/CMakeLists.txt
+++ b/plugins/wimax/CMakeLists.txt
@@ -82,11 +82,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/wimaxasncp/CMakeLists.txt b/plugins/wimaxasncp/CMakeLists.txt
index 46113d91d9..d3b7819752 100644
--- a/plugins/wimaxasncp/CMakeLists.txt
+++ b/plugins/wimaxasncp/CMakeLists.txt
@@ -37,11 +37,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/plugins/wimaxmacphy/CMakeLists.txt b/plugins/wimaxmacphy/CMakeLists.txt
index 736ed9d316..49b32df350 100644
--- a/plugins/wimaxmacphy/CMakeLists.txt
+++ b/plugins/wimaxmacphy/CMakeLists.txt
@@ -37,11 +37,11 @@ set(CLEAN_FILES
${PLUGIN_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/tools/lemon/CMakeLists.txt b/tools/lemon/CMakeLists.txt
index d0b7cb84ae..f76cfe1f18 100644
--- a/tools/lemon/CMakeLists.txt
+++ b/tools/lemon/CMakeLists.txt
@@ -27,11 +27,11 @@ set(CLEAN_FILES
${lemon_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
index 55831df520..fa714f6fc3 100644
--- a/ui/CMakeLists.txt
+++ b/ui/CMakeLists.txt
@@ -81,11 +81,11 @@ set(CLEAN_FILES
${COMMON_UI_SRC}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/ui/gtk/CMakeLists.txt b/ui/gtk/CMakeLists.txt
index de9a0aaad6..371801ca93 100644
--- a/ui/gtk/CMakeLists.txt
+++ b/ui/gtk/CMakeLists.txt
@@ -232,11 +232,11 @@ set(CLEAN_FILES
${WIRESHARK_TAP_SRC}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS "-Werror -Wno-error=deprecated-declarations"
+ COMPILE_FLAGS "${WERROR_COMMON_FLAGS} ${NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS}"
)
endif()
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index ed3d0a5e59..d39be1ca97 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -468,20 +468,12 @@ else()
# set_target_properties(${some-source-files} PROPERTIES AUTOMOC TRUE)
endif()
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${WIRESHARK_QT_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
- # The Qt headers generate a ton of shortening errors on 64-bit systems.
- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set_source_files_properties(
- ${WIRESHARK_QT_FILES}
- PROPERTIES
- COMPILE_FLAGS -Wno-shorten-64-to-32
- )
- endif()
endif()
add_definitions(${QT_DEFINITIONS})
diff --git a/ui/qt/rpc_service_response_time_dialog.cpp b/ui/qt/rpc_service_response_time_dialog.cpp
index 50253275bd..7b492aa43f 100644
--- a/ui/qt/rpc_service_response_time_dialog.cpp
+++ b/ui/qt/rpc_service_response_time_dialog.cpp
@@ -19,6 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+// warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4267)
+#endif
+
#include "rpc_service_response_time_dialog.h"
#include <algorithm>
@@ -35,6 +41,10 @@
#include <QHBoxLayout>
#include <QLabel>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
// To do:
// - Don't assume that the user knows what programs+versions are in the
// capture. I.e. combine this dialog with the ONC-RPC Programs dialog,
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index 1a516a02fe..083d3fde0d 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -19,6 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+// warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4267)
+#endif
+
#include "wireshark_application.h"
#include <algorithm>
@@ -81,6 +87,10 @@
#include <QLibrary>
#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
WiresharkApplication *wsApp = NULL;
// XXX - Copied from ui/gtk/file_dlg.c
diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt
index 328012fd13..e3eb20aa6f 100644
--- a/wiretap/CMakeLists.txt
+++ b/wiretap/CMakeLists.txt
@@ -81,11 +81,11 @@ set(WIRETAP_FILES
wtap.c
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${WIRETAP_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
endif()
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index 364de2fc77..d8870fe041 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -180,11 +180,11 @@ set(CLEAN_FILES
${WSUTIL_FILES}
)
-if (WERROR)
+if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${CLEAN_FILES}
PROPERTIES
- COMPILE_FLAGS -Werror
+ COMPILE_FLAGS ${WERROR_COMMON_FLAGS}
)
else()
#