Allen Bierbaum wrote:
> That said, it seems that some of the warnings could be nice to turn off
> or to have an easy way to auto handle in a generation script.
>
> For example:
>
> WARNING: __gnu_debug [namespace]
>> pyplusplus, by default, does not exposes internal compilers
>> declarations. Names of those declarations starts with "__".
>
> I understand this message, I don't want to export this namespace and as
> far as I know, I am not even attempting to export this namespace (does
> this message crop up even if the namespace is not exposed?).
I believe Roman's module builder exposes everything by default (is that
correct, Roman?), so I guess you have to exclude that namespace explicitly.
I haven't seen this particular message yet here, but a similar one about
compiler generated declarations (which pyplusplus actually suppresses).
I think the above warning is also a case that pyplusplus doesn't have to
report at all. If that namespace is only generated by the compiler and
does not appear in any source file at all then it's nothing that a user
ever wants to expose.
> Is there
> any way to automatically remove all places where this would be
> triggered? it seems like a reasonable default.
The logging module has filter classes that you could probably use in
such a case. But I suppose it's easier to just exclude that namespace.
> WARNING: osg::FieldContainer &
> osg::FieldContainer::operator=(osg::FieldContainer const & other)
> [member_operator]
>> "operator=" is not supported. See Boost.Python documentation:
>> http://www.boost.org/libs/python/doc/v2/operators.html#introduction.
>
> Another good one. If I expose a class and it has an op=, then I don't
> want to expose it. But is there a way to just make this the default and
> not make me go through and remove them all manually to prevent these
> warnings from being spit out?
Maybe an option to control this would indeed by reasonable (or maybe
they should be turned into 'info' messages instead of 'warning'
messages?)....
But the current workaround (i.e. ignoring those operators) should be a
one-liner. With pypp_api it would be:
root.Methods("operator=", recursive=True).ignore()
or, what I have in my script:
mod.Methods(["operator=", "operator++", "operator--"],
recursive=True).ignore()
I'm not so familiar with Roman's syntax, but I guess it looks similar.
- Matthias -
|