Suppress MSVC warnings using pragmas (#295)
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Thu, 28 May 2009 12:11:50 +0100
changeset 671da70af8844b9
parent 670 926c47568a56
child 672 dbf22d9222a2
Suppress MSVC warnings using pragmas (#295)
CMakeLists.txt
lemon/core.h
     1.1 --- a/CMakeLists.txt	Wed May 13 10:42:26 2009 +0200
     1.2 +++ b/CMakeLists.txt	Thu May 28 12:11:50 2009 +0100
     1.3 @@ -17,16 +17,6 @@
     1.4  FIND_PACKAGE(CPLEX)
     1.5  FIND_PACKAGE(COIN)
     1.6  
     1.7 -IF(MSVC)
     1.8 -  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
     1.9 -# Suppressed warnings:
    1.10 -# C4250: 'class1' : inherits 'class2::member' via dominance
    1.11 -# C4355: 'this' : used in base member initializer list
    1.12 -# C4503: 'function' : decorated name length exceeded, name was truncated
    1.13 -# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    1.14 -# C4996: 'function': was declared deprecated
    1.15 -ENDIF(MSVC)
    1.16 -
    1.17  INCLUDE(CheckTypeSize)
    1.18  CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
    1.19  
     2.1 --- a/lemon/core.h	Wed May 13 10:42:26 2009 +0200
     2.2 +++ b/lemon/core.h	Thu May 28 12:11:50 2009 +0100
     2.3 @@ -27,6 +27,16 @@
     2.4  #include <lemon/bits/traits.h>
     2.5  #include <lemon/assert.h>
     2.6  
     2.7 +// Disable the following warnings when compiling with MSVC:
     2.8 +// C4250: 'class1' : inherits 'class2::member' via dominance
     2.9 +// C4355: 'this' : used in base member initializer list
    2.10 +// C4503: 'function' : decorated name length exceeded, name was truncated
    2.11 +// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    2.12 +// C4996: 'function': was declared deprecated
    2.13 +#ifdef _MSC_VER
    2.14 +#pragma warning( disable : 4250 4355 4503 4800 4996 )
    2.15 +#endif
    2.16 +
    2.17  ///\file
    2.18  ///\brief LEMON core utilities.
    2.19  ///