[Coin-discuss] MSV pragma

Matthew Galati Matthew.Galati at sas.com
Sat Apr 7 15:54:10 EDT 2007


FYI. I was able to get a clean MSVS8 build by disabling the following warnings in the following projects.

For the most part, they look harmless and are probably ok to ignore. But, that is up to each developer to determine.

Can we, fix the warnings that are not safe, and either:
 (a) add /wd flags to each MSVS project workspace,
 (b) have each project add a pragma file disabling the approriate warnings?

Thanks,
Matt


Alps:      4290;4267;4800;4996;4065
Bcps:      4290;4267;4996;4065
CoinUtils: 4996;4244;4800;4065;4102
Clp:       4244;4305;4800   
OsiClp:    4800
Cgl:       4805;4996
Cbc:       4800;4244;4065
Osi:        clean 
OsiCbc:     clean

Examples of each:

At a glance, probably ok to ignore:

Warning	1	warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)	c:\cygwin\home\magala\coin\coin-decomp\alps\src\AlpsEncoded.h	111	
Warning	18	warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data	c:\cygwin\home\magala\coin\coin-decomp\alps\src\AlpsEncoded.h	282	
Warning	11	warning C4996: 'std::_Copy_opt' was declared deprecated	C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility	2282	
Warning	1	warning C4065: switch statement contains 'default' but no 'case' labels	c:\cygwin\home\magala\COIN\coin-Decomp\Bcps\src\BcpsMessage.cpp	60	
Warning	1	warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)	c:\cygwin\home\magala\COIN\coin-Decomp\Alps\src\AlpsKnowledgeBrokerSerial.cpp	162
Warning	7	warning C4102: 'yyerrorlab' : unreferenced label	c:\cygwin\home\magala\coin\coin-decomp\coinutils\src\coinmodeluseful2.cpp	1349		



Might not want to ignore?

Warning	13	warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data	c:\cygwin\home\magala\coin\coin-decomp\coinutils\src\coinindexedvector.cpp	546
Warning	25	warning C4244: '=' : conversion from 'const double' to 'float', possible loss of data	c:\cygwin\home\magala\coin\coin-decomp\clp\src\clpdynamicexamplematrix.cpp	126	
Warning	16	warning C4305: '=' : truncation from 'double' to 'float'	c:\cygwin\home\magala\coin\coin-decomp\clp\src\clpgubdynamicmatrix.cpp	146		






-----Original Message-----
From: coin-discuss-bounces at list.coin-or.org [mailto:coin-discuss-bounces at list.coin-or.org] On Behalf Of Matthew Galati
Sent: Sunday, April 01, 2007 8:46 AM
To: Discussions about open source software for Operations Research
Subject: [Coin-discuss] MSV pragma

When built in MSV, several COIN projects trigger warnings C4290/C4996. I am fine ignoring them, but can we get them disabled? In my project, I do it in my DecompConfig.h. But, my project depends on several other COIN projects - so I get a very messy build log when building the deps. 

Can we somehow add these across the board? Maybe putting them in CoinPragma.hpp? Although I am not sure all projects include CoinPragma.hpp.

Thanks,
Matt


/***************************************************************************/
/*             HERE DEFINE MS PRAGMAS TO DISABLE SOME WARNINGS             */
/***************************************************************************/
#include "CoinPragma.hpp"
#if defined(_MSC_VER)
// warning C4290: C++ exception specification ignored except to indicate // a function is not __declspec(nothrow) # pragma warning(disable:4290) //warning C4996: 'std::xxx' was declared deprecated # pragma warning(disable:4996) #endif



_______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss




More information about the Coin-discuss mailing list