[Ns-developers] Containers (Was: What's wrong with pybindgen in Cygwin?)

Gustavo Carneiro gjcarneiro at gmail.com
Fri Aug 29 07:02:13 PDT 2008


2008/8/28 Gustavo Carneiro <gjcarneiro at gmail.com>

>
>
> 2008/8/28 Mathieu Lacage <mathieu.lacage at sophia.inria.fr>
>
>>
>> On Thu, 2008-08-28 at 09:34 -0700, Mathieu Lacage wrote:
>>
>> > interesting. It looks like the bug is in gccxml or pybindgen usage of
>> > gccxml: uint32_t should not be converted to unsigned int: you should be
>> > able to detect that you have a typedef here and use the outer typedef
>> > rather than the underlying type.
>>
>> I failed to explain why I think this is a bug in gccxml or pybindgen. If
>> you do what you do right now, what happens is that the typedefs are
>> effectively cast in stone when ./waf --python-scan is run which means
>> that we can't store in our repo the output of ./waf --python-scan
>> because all these typedefs are platform-specific and can all differ
>> subtly from platform to platform.
>>
>
> I agree 100% with you.  However, I am not sure I can fix it.  Further
> investigation lead me to believe this is a bug in gccxml itself.  I reported
> it [1] and await to see what the maintainer thinks.
>
>
> [1] http://www.gccxml.org/Bug/view.php?id=7572
>
>
>>
>>
>> So, the alternatives are either we make ./waf --python-scan not use the
>> underlying types but use the typedef
>
>
> Like I said, nothing I can do in pybindgen side.  All we can hope for right
> now is to force pybindgen to ignore the container types for now, so that at
> least people can build ns-3.
>

OK, I committed what should fix the problem.  The only solution I could come
up with is to ignore unnamed containers and only include typedef'ed
containers.

So basically Python bindings will not be able to use this API (Ipv4Route):

  /**
   * \return A vector of all of the output interfaces of this route.
   */
  std::vector<uint32_t> GetOutputInterfaces (void) const;

But if we do this instead, then it will work:

  typedef std::vector<uint32_t> InterfaceList;
  /**
   * \return A vector of all of the output interfaces of this route.
   */
  InterfaceList GetOutputInterfaces (void) const;


-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list