[CoinUtils-tickets] [COIN-OR Common Utilities] #68: Visual Studio warnings in libCoinUtils

COIN-OR Common Utilities coin-trac at coin-or.org
Tue Oct 4 16:29:18 EDT 2011


#68: Visual Studio warnings in libCoinUtils
--------------------------------+-------------------------------------------
Reporter:  davewilk             |       Type:  defect                             
  Status:  new                  |   Priority:  minor                              
 Version:  stable/2.6 or 2.6.x  |   Keywords:  libCoinUtils Visual Studio warnings
--------------------------------+-------------------------------------------
 I received this CoinUtils with Bonmin 1.5.0, so I hope I have specified
 the correct version of CoinUtils.

 Anyway, 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/CoinUtils/ticket/68>
COIN-OR Common Utilities <http://projects.coin-or.org/CoinUtils>
Common data structures and linear algebra functions for COIN-OR projects



More information about the CoinUtils-tickets mailing list