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)
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*
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:
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/* 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.