Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio warnings in libCoinUtils #68

Closed
svigerske opened this issue Mar 2, 2019 · 4 comments
Closed

Visual Studio warnings in libCoinUtils #68

svigerske opened this issue Mar 2, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@svigerske
Copy link
Member

Issue created by migration from Trac.

Original creator: davewilk

Original creation time: 2011-10-04 20:29:18

Version: stable/2.6 or 2.6.x

CC: xyz-coin@effisols.com

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;

  1. 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?

  1. 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

@svigerske svigerske added bug Something isn't working minor labels Mar 2, 2019
@svigerske
Copy link
Member Author

Comment by @LouHafer created at 2011-10-04 20:40:03

Dave, thanks for the ticket. I don't think we will do anything about !#1 and !#2; the code in question is generated by the bison parser generator. (That begs the question, where is the bison source? I'll have to chase that.) !#3 looks like an artifact left by one of our developers. It's disabled (#if 0) in trunk, and that'd be my recommendation if you need to suppress the warning.

I'm going to leave this open while I try to chase down the bison source.

@svigerske
Copy link
Member Author

Comment by @LouHafer created at 2011-10-04 20:40:03

Set assignee to @LouHafer.

@svigerske
Copy link
Member Author

Comment by @LouHafer created at 2011-10-04 20:40:03

Changing status from new to assigned.

@svigerske
Copy link
Member Author

I've removed the empty switch statements from 1) for now and removed the #ifdef __GNUC for 2), but as @LouHafer pointed out, this may come back if someone ever regenerates this code.
The code from point 3) is gone from current CoinUtils versions and we're not going to patch up stable/2.6 anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant