diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-09-14 17:19:02 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-10-16 21:32:22 +0000 |
commit | b05803db4b7079307565e423a8caf828949add49 (patch) | |
tree | 2d2d450c462d4abb7914d766fc2ef40ebb1c640d /ui | |
parent | 1ecb4de74497682a5174e3219ee3b44835832ca2 (diff) | |
download | wireshark-b05803db4b7079307565e423a8caf828949add49.tar.gz |
CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.
We haven't compiled C++ code with -Wshorten-64-to-32 for quite
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.
Additionally, squelch
----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
with
[
_Iter=QList<QString>::iterator
, _RanIt=QList<QString>::iterator
, _Diff=int
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
.\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----
in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.
Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/CMakeLists.txt | 4 | ||||
-rw-r--r-- | ui/gtk/CMakeLists.txt | 4 | ||||
-rw-r--r-- | ui/qt/CMakeLists.txt | 12 | ||||
-rw-r--r-- | ui/qt/rpc_service_response_time_dialog.cpp | 10 | ||||
-rw-r--r-- | ui/qt/wireshark_application.cpp | 10 |
5 files changed, 26 insertions, 14 deletions
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 |