Author

Topic: Building Armory 0.93.3 throws Warnings (Read 759 times)

newbie
Activity: 22
Merit: 0
November 02, 2015, 04:24:24 AM
#5
Alright, thanks guys Smiley
legendary
Activity: 3766
Merit: 1364
Armory Developer
November 01, 2015, 08:39:24 AM
#4
Yes, these are all completely benign warnings. There is a straight forward explanation for every one of these. The forward declaration one is kinda silly but then again, you'd rather it warns you about that than not.

Same with nested struct. SWIG users should know these get ignored, plus that's the point of a nested struct anyways, to be used internally by the class.

The typecheck error is a bit more complicated. If you look at the code SWIG outputs, you'll understand what the warning actually means. This is the SWIG wrapper for BtcWallet::BtcWallet(BlockDataViewer*, BinaryData) (https://github.com/etotheipi/BitcoinArmory/blob/master/cppForSwig/BtcWallet.h#L78)

Code:
SWIGINTERN PyObject *_wrap_new_BtcWallet__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  BlockDataViewer *arg1 = (BlockDataViewer *) 0 ;
  BinaryData arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  PyObject * obj1 = 0 ;
  BtcWallet *result = 0 ;
 
  if (!PyArg_ParseTuple(args,(char *)"OO:new_BtcWallet",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BlockDataViewer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_BtcWallet" "', argument " "1"" of type '" "BlockDataViewer *""'");
  }
  arg1 = reinterpret_cast< BlockDataViewer * >(argp1);
  {
    if(!PyString_Check(obj1))
    {
      PyErr_SetString(PyExc_ValueError, "Expected string argument!");
      return NULL;
    }
   
    arg2 = BinaryData((uint8_t*)PyString_AsString(obj1), PyString_Size(obj1));
  }
  {
    try
    {
      {
        SWIG_PYTHON_THREAD_BEGIN_ALLOW;
        result = (BtcWallet *)new BtcWallet(arg1,arg2);
        SWIG_PYTHON_THREAD_END_ALLOW;
      }
    }
    catch (std::exception& e)
    {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BtcWallet, SWIG_POINTER_NEW |  0 );
  return resultobj;
fail:
  return NULL;
}

As you can see, arg1 goes through a typecheck before being casted to BlockDataViewer*

Code:
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BlockDataViewer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_BtcWallet" "', argument " "1"" of type '" "BlockDataViewer *""'");
  }
  arg1 = reinterpret_cast< BlockDataViewer * >(argp1);

arg2, however, gets no typecheck:

Code:
    arg2 = BinaryData((uint8_t*)PyString_AsString(obj1), PyString_Size(obj1));

You can find the reason for this difference in argument handling in our SWIG instruction file: https://github.com/etotheipi/BitcoinArmory/blob/master/cppForSwig/CppBlockUtils.i#L93

Code:
/* Convert Python(str) to C++(BinaryData) */
%typemap(in) BinaryData
{
   if(!PyString_Check($input))
   {
      PyErr_SetString(PyExc_ValueError, "Expected string argument!");
      return NULL;
   }
   
   $1 = BinaryData((uint8_t*)PyString_AsString($input), PyString_Size($input));
}

In the case of BlockDataViewer (and most other classes in our codebase), we let SWIG do the wrapping by default. With BinaryData, we enforce an explicit conversion, from and to Python strings, because this is what we need that object for.
newbie
Activity: 22
Merit: 0
November 01, 2015, 08:02:06 AM
#3
So ... ?
What to do ? Ignore ?
legendary
Activity: 3766
Merit: 1364
Armory Developer
November 01, 2015, 07:36:38 AM
#2
SWIG warnings.
newbie
Activity: 22
Merit: 0
November 01, 2015, 07:06:09 AM
#1
Hi all,
I'm getting some strange Warnings when building the latest version from GitHub.
I'm on a CentOS 7 (64Bit) box.
Any ideas what's the matter ?

Code:
Language subdirectory: python
Search paths:
   ./
   ./swig_lib/python/
   /usr/share/swig/2.0.10/python/
   ./swig_lib/
   /usr/share/swig/2.0.10/
Preprocessing...
Starting language-specific parse...
BlockUtils.h:153: Warning 325: Nested class not currently supported (Notifier ignored)
BlockUtils.h:203: Warning 325: Nested struct not currently supported (BlkFileUpdateCallbacks ignored)
EncryptionUtils.h:181: Warning 362: operator= ignored
ScrAddrObj.h:288: Warning 362: operator= ignored
Blockchain.h:38: Warning 325: Nested struct not currently supported (ReorganizationState ignored)
BlockDataManagerConfig.h:58: Warning 362: operator= ignored
Processing types...
EncryptionUtils.h:136: Warning 402: Base class 'BinaryData' is incomplete.
BDM_mainthread.h:26: Warning 402: Only forward declaration 'BinaryData' was found.
BDM_mainthread.h:49: Warning 402: Base class 'BlockDataManager_LevelDB::Notifier' is incomplete.
BlockUtils.h:153: Warning 402: Only forward declaration 'BlockDataManager_LevelDB::Notifier' was found.
C++ analysis...
Generating wrappers...
BtcWallet.h:26: Warning 472: Overloaded method AddressBookEntry::AddressBookEntry(BinaryData) with no explicit typecheck typemap for arg 0 of type 'BinaryData'
BtcWallet.h:80: Warning 472: Overloaded method BtcWallet::BtcWallet(BtcWallet const &) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
BtcWallet.h:99: Warning 472: Overloaded method BtcWallet::addScrAddress(BinaryData) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
BtcWallet.h:99: Warning 472: Overloaded method BtcWallet::addScrAddress(BinaryData) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
BtcWallet.h:99: Warning 472: Overloaded method BtcWallet::addScrAddress(BinaryData) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
BtcWallet.h:99: Warning 472: Overloaded method BtcWallet::addScrAddress(BinaryData) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
BtcWallet.h:99: Warning 472: Overloaded method BtcWallet::addScrAddress(BinaryData) with no explicit typecheck typemap for arg 1 of type 'BinaryData'
ScrAddrObj.h:184: Warning 472: Overloaded method ScrAddrObj::ScrAddrObj(ScrAddrObj const &) with no explicit typecheck typemap for arg 2 of type 'BinaryData'
ScrAddrObj.h:184: Warning 472: Overloaded method ScrAddrObj::ScrAddrObj(ScrAddrObj const &) with no explicit typecheck typemap for arg 2 of type 'BinaryData'
ScrAddrObj.h:184: Warning 472: Overloaded method ScrAddrObj::ScrAddrObj(ScrAddrObj const &) with no explicit typecheck typemap for arg 2 of type 'BinaryData'
ScrAddrObj.h:184: Warning 472: Overloaded method ScrAddrObj::ScrAddrObj(ScrAddrObj const &) with no explicit typecheck typemap for arg 2 of type 'BinaryData'
ScrAddrObj.h:184: Warning 472: Overloaded method ScrAddrObj::ScrAddrObj(ScrAddrObj const &) with no explicit typecheck typemap for arg 2 of type 'BinaryData'
g++  -O2 -pipe -fPIC  -Icryptopp -Imdb -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS -I/usr/include/python2.7 -I/usr/include/python2.7 -std=c++11 -c CppBlockUtils_wrap.cxx
g++ -shared -fPIC  -O2 -pipe -fPIC UniversalTimer.o BinaryData.o lmdb_wrapper.o StoredBlockObj.o BtcUtils.o BlockObj.o BlockUtils.o EncryptionUtils.o BtcWallet.o LedgerEntry.o ScrAddrObj.o Blockchain.o BlockWriteBatcher.o BDM_mainthread.o lmdbpp.o BDM_supportClasses.o BlockDataViewer.o HistoryPager.o Progress.o libcryptopp.a mdb.o midl.o txio.o  CppBlockUtils_wrap.o -lpthread -Lmdb -lrt -o ../_CppBlockUtils.so
pyrcc4 -o ../qrc_img_resources.py ../imgList.xml
make[1]: Leaving directory `/work/BitcoinArmory/cppForSwig'
Jump to: