qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1601010 - /qpid/proton/trunk/proton-c/CMakeLists.txt
Date Fri, 06 Jun 2014 20:53:58 GMT
Author: chug
Date: Fri Jun  6 20:53:57 2014
New Revision: 1601010

URL: http://svn.apache.org/r1601010
PROTON-596: Suppress MSVC warnings

This suppression covers:

   warning C4244: 'argument' : conversion from 'ssize_t' to 'int',
   possible loss of data
   warning C4267: 'argument' : conversion from 'size_t' to 'int',
   possible loss of data
   warning C4800: 'int' : forcing value to bool 'true' or 'false'
   (performance warning)
   warning C4996: 'sscanf': This function or variable may be unsafe.
   Consider using sscanf_s instead. 
   To disable deprecation, use _CRT_SECURE_NO_WARNINGS

This covers the majority of the warnings. A typical 64-bit compile has 172 
warnings making real problems harder to see. It also follows the
pattern used in Qpid proper.

* C4244 and C4267 could still be real problems.
  Try enabling -Wconversion in GCC if you want to be pedantic in Qpid or

* C4800 is probably not a risk as it's a fairly idiomatic pattern in C.

* C4996 is MSVC complaining of functions that consume buffers using
 {pointer} and not {pointer, size}. They have been the source of seg
 faults and innumerable security vulnerabilities throughout the years.


Modified: qpid/proton/trunk/proton-c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/CMakeLists.txt?rev=1601010&r1=1601009&r2=1601010&view=diff
--- qpid/proton/trunk/proton-c/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/CMakeLists.txt Fri Jun  6 20:53:57 2014
@@ -224,7 +224,13 @@ if (CMAKE_COMPILER_IS_GNUCC)
 if (MSVC)
+    add_definitions(
+        /wd4244
+        /wd4267
+        /wd4800
+        /wd4996
+    )
 endif (MSVC)
 macro (pn_absolute_install_dir NAME VALUE PREFIX)

To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org

View raw message