[Coin-discuss] NDEBUG & COIN_ASSERT

John J Forrest jjforre at us.ibm.com
Thu Jul 14 14:29:59 EDT 2005


Edgardo,

I have moved an #endif in CoinError.hpp - does that help?  (No errors on 
my gcc but I can see that VC might get confused if it saw 

        #if (__GNUC_PREREQ (2,6))

I have tidied code to get rid of some unused variable warnings with 
-NDEBUG

Uninitialized warnings seem to be compiler mistake.

John Forrest



Edgardo Fuchs <edgardo_fuchs at mi.cl> 
Sent by: coin-discuss-bounces at list.coin-or.org
07/12/2005 10:42 PM
Please respond to
edgardo_fuchs and Discussions about open source software for Operations 
Research 


To
COIN <coin-discuss at list.coin-or.org>
cc

Subject
[Coin-discuss] NDEBUG & COIN_ASSERT






Dear COIN list,

I compiled Coin, Clp, Osi and OsiClp, with both gcc and VC Toolkit.

Both of them produce errors with NDEBUG & COIN_ASSERT options.
gcc produces a warning message with only NDEBUG option.
VC Toolkit compiles without messages using only NDEBUG option.

I included a text file with the compilation messages.

Regards,
Edgardo Fuchs

-- 

Edgardo Fuchs

Santiago, Chile

Tel: +56 (2) 435 0090
Cel: +56 9837 8433
gcc 3.4.4-1
Eclipse IDE
Win XP home

Compiler options:
-DNDEBUG -DCOIN_ASSERT -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings 
-Wconversion -pipe -O3


Coin:
====

In file included from 
C:/cpp/eclipse/Coin/include/CoinHelperFunctions.hpp:13,
                 from ../CoinBuild.cpp:16:
C:/cpp/eclipse/Coin/include/CoinError.hpp:203:24: missing binary operator 
before token "("


Clp:
===

In file included from C:/cpp/eclipse/Coin/include/CoinPackedMatrix.hpp:6,
                 from C:/cpp/eclipse/Clp/include/ClpMatrixBase.hpp:8,
                 from C:/cpp/eclipse/Clp/include/ClpModel.hpp:12,
                 from C:/cpp/eclipse/Clp/include/ClpInterior.hpp:19,
                 from ../ClpCholeskyBase.cpp:9:
C:/cpp/eclipse/Coin/include/CoinError.hpp:203:24: missing binary operator 
before token "("
../ClpCholeskyBase.cpp: In member function `virtual int 
ClpCholeskyBase::symbolic()':
../ClpCholeskyBase.cpp:1017: warning: 'sizeFactor' might be used 
uninitialized in this function


Building file: ../ClpModel.cpp
g++ -DNDEBUG -DCOIN_ASSERT -IC:\cpp\eclipse\Clp\include 
-IC:\cpp\eclipse\Coin\include -O3 -Wall -c -Wpointer-arith -Wcast-qual 
-Wwrite-strings -Wconversion -pipe -oClpModel.o ../ClpModel.cpp
In file included from 
C:/cpp/eclipse/Coin/include/CoinHelperFunctions.hpp:13,
                 from ../ClpModel.cpp:14:
C:/cpp/eclipse/Coin/include/CoinError.hpp:203:24: missing binary operator 
before token "("
../ClpModel.cpp: In member function `void ClpModel::setRowBounds(int, 
double, double)':
../ClpModel.cpp:444: error: `__STRING' undeclared (first use this 
function)
../ClpModel.cpp:444: error: (Each undeclared identifier is reported only 
once for each function it appears in.)


Osi:
===

In file included from 
C:/cpp/eclipse/Coin/include/CoinPackedVectorBase.hpp:13,
                 from C:/cpp/eclipse/Coin/include/CoinPackedVector.hpp:13,
                 from C:/cpp/eclipse/Osi/include/OsiColCut.hpp:8,
                 from ../OsiColCut.cpp:8:
C:/cpp/eclipse/Coin/include/CoinError.hpp:203:24: missing binary operator 
before token "("


OsiClp:
======

In file included from 
C:/cpp/eclipse/Coin/include/CoinHelperFunctions.hpp:13,
                 from ../OsiClpSolverInterface.cpp:8:
C:/cpp/eclipse/Coin/include/CoinError.hpp:203:24: missing binary operator 
before token "("
../OsiClpSolverInterface.cpp: In member function `void 
OsiClpSolverInterface::setupForRepeatedUse(int, int)':
../OsiClpSolverInterface.cpp:525: warning: unused variable 'gotHint'
../OsiClpSolverInterface.cpp: In member function `virtual void 
OsiClpSolverInterface::solveFromHotStart()':
../OsiClpSolverInterface.cpp:931: warning: unused variable 'gotHint'
../OsiClpSolverInterface.cpp:1010: error: `__STRING' undeclared (first use 
this function)
../OsiClpSolverInterface.cpp:1010: error: (Each undeclared identifier is 
reported only once for each function it appears in.)
../OsiClpSolverInterface.cpp: In member function `virtual void 
OsiClpSolverInterface::enableSimplexInterface(bool)':
../OsiClpSolverInterface.cpp:2610: warning: unused variable 'returnCode'


Clp without COIN_ASSERT option:
==============================

../ClpCholeskyBase.cpp: In member function `virtual int 
ClpCholeskyBase::symbolic()':
../ClpCholeskyBase.cpp:1017: warning: 'sizeFactor' might be used 
uninitialized in this function
Finished building: ../ClpCholeskyBase.cpp

/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h: In member 
function `std::vector<_Tp, _Alloc>& std::vector<_Tp, 
_Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = 
std::string, _Alloc = std::allocator<std::string>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h:715: 
warning: '__result' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h: In 
member function `void std::vector<_Tp, 
_Alloc>::_M_fill_insert(__gnu_cxx::__normal_iterator<typename 
_Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&) [with _Tp 
= std::string, _Alloc = std::allocator<std::string>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
../ClpModel.cpp: In member function `int ClpModel::readMps(const char*, 
bool, bool)':
../ClpModel.cpp:2209: warning: 'savePrefix' might be used uninitialized in 
this function
../ClpModel.cpp:2211: warning: 'time1' might be used uninitialized in this 
function
Finished building: ../ClpModel.cpp

/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h: In member 
function `std::vector<_Tp, _Alloc>& std::vector<_Tp, 
_Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = 
std::string, _Alloc = std::allocator<std::string>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h:715: 
warning: '__result' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h: In 
member function `void std::vector<_Tp, 
_Alloc>::_M_fill_insert(__gnu_cxx::__normal_iterator<typename 
_Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&) [with _Tp 
= std::string, _Alloc = std::allocator<std::string>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: 
warning: '__cur' might be used uninitialized in this function
Finished building: ../ClpSimplex.cpp


// 
============================================================================


Visual C++ Toolkit 2003
Code::Blocks IDE
Win Xp home

Compiler options:
/nologo /W1 /GR /GX /O2 /YX /FD /c /D WIN32 /D NDEBUG /D COIN_ASSERT /D 
_MBCS /D _LIB


Coin:
====

CoinBuild.cpp
c:\cpp\CoinVC\Coin\include\CoinError.hpp(203) : fatal error C1012: 
unmatched parenthesis : missing ')'
Process terminated with status 1 (0 minutes, 10 seconds)
1 errors, 0 warnings


Clp:
===

ClpCholeskyBase.cpp
c:\cpp\CoinVC\Coin\include\CoinError.hpp(203) : fatal error C1012: 
unmatched parenthesis : missing ')'
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings


Osi:
===

OsiCut.cpp
c:\cpp\CoinVC\Coin\include\CoinError.hpp(203) : fatal error C1012: 
unmatched parenthesis : missing ')'
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 0 warnings


OsiClp:
======

OsiClpSolverInterface.cpp
c:\cpp\CoinVC\Coin\include\CoinError.hpp(203) : fatal error C1012: 
unmatched parenthesis : missing ')'
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20050714/dbfbaf02/attachment.html>


More information about the Coin-discuss mailing list