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
Log:
PROTON-596: Suppress MSVC warnings

This suppression covers:

>..\..\proton-c\src\object\object.c(232): 
   warning C4244: 'argument' : conversion from 'ssize_t' to 'int',
   possible loss of data
2>..\..\proton-c\src\object\object.c(260):
   warning C4267: 'argument' : conversion from 'size_t' to 'int',
   possible loss of data
2>..\..\proton-c\src\windows\driver.c(777):
   warning C4800: 'int' : forcing value to bool 'true' or 'false'
   (performance warning)
6>..\..\..\..\..\tests\tools\apps\c\msgr-recv.c(90): 
   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
  Proton.

* 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

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)
 endif (CMAKE_COMPILER_IS_GNUCC)
 
 if (MSVC)
-	set(CMAKE_DEBUG_POSTFIX "d")
+    set(CMAKE_DEBUG_POSTFIX "d")
+    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


Mime
View raw message