I'm trying to expose this function to Python using SWIG:
std::vector<int> get_match_stats();
And I want SWIG to generate wrapping code for Python so I can see it as a list of integers.
Adding this to the .i file:
%include "typemaps.i" %include "std_vector.i" namespace std { %template(IntVector) vector<int>; }
I'm running SWIG Version 1.3.36
and calling swig with -Wall
and I get no warnings.
I'm able to get access to a list but I get a bunch of warnings when compiling with -Wall
(with g++ (GCC) 4.2.4
) the generated C++ code that say:
warning: dereferencing type-punned pointer will break strict-aliasing rules
Am I exposing the function correctly? If so, what does the warning mean?