[Bonmin-tickets] [Bonmin] #48: Visual Studio warnings in libCoinUtils
Bonmin
coin-trac at coin-or.org
Thu Sep 29 10:40:07 EDT 2011
#48: Visual Studio warnings in libCoinUtils
---------------------+------------------------------------------------------
Reporter: davewilk | Owner: pbonami
Type: defect | Status: new
Priority: minor | Component: Bonmin
Version: 1.5 | Keywords: libCoinUtils Visual Studio warnings
---------------------+------------------------------------------------------
There are a number of warnings in Visual Studio 2008 coming from compiling
libCoinUtils project at
CoinUtils\MSVisualStudio\v9\libCoinUtils\libCoinUtils.vcproj
1. coinmodeluseful2.cpp(706) : warning C4065: switch statement contains
'default' but no 'case' labels
This is maybe a silly warning, but it is easily suppressed by adding a
case label:
case 0: default:
break;
2. coinmodeluseful2.cpp(1358) : warning C4102: 'yyerrorlab' : unreferenced
label
There is following code to suppress this for GCC:
#ifdef __GNUC__
/* Pacify GCC when the user code never invokes YYERROR and the label
yyerrorlab therefore never appears in user code. */
if (0)
goto yyerrorlab;
#endif
Why not just remove the #ifdef?
3. coinpresolvesingleton.cpp(125) : warning C4804: '>' : unsafe use of
type 'bool' in operation
This comes from the following weird piece of code
if (prob->tuning_>10) {
// really for gcc 4.6 compiler bug
printf("jcol %d %g %g irow %d %g %g coeff %g\n",
jcol,clo[jcol],cup[jcol],irow,rlo[irow],rup[irow],coeff);
}
I have no idea what the purpose of this is, but the warning can easily be
eliminated by casting to int:
if ((int)prob->tuning_ > 10)
Thanks,
David Wilkinson
--
Ticket URL: <https://projects.coin-or.org/Bonmin/ticket/48>
Bonmin <http://projects.coin-or.org/Bonmin>
Basic Open-source Nonlinear Mixed INteger programming
More information about the Bonmin-tickets
mailing list