[Pyrex] Support for qualifiers

Jelmer Vernooij jelmer at samba.org
Tue Mar 25 18:14:57 CET 2008


Am Mittwoch, den 19.03.2008, 11:05 +1200 schrieb Greg Ewing: 
> Jelmer Vernooij wrote:
> > Pyrex at the moment doesn't support qualifiers on arguments in C
> > function prototypes. This causes an awful lot of warnings when writing
> > bindings for libraries that make heavy use of the const keyword.
> I haven't found it to cause all that many problems,
> because passing a non-const pointer to something
> declared as const, which is the most frequent
> case, is okay. I can appreciate that some libraries
> may be more troublesome than others in this regard,
> though.
I've got quite a few callbacks I have to pass to C functions. This means
casting a pyrex implementation without const to a typedef with const.
Another place where it is problematic is for functions that take a
"const char **" argument. 

We make heavy use of const in Samba, but I'm also running into it while
wrapping the Subversion libraries. It's not really problematic but it
makes it harder to notice warnings that actually matter.

> > Are there any plans to support these kinds of qualifiers or perhaps use
> > const more in the generated code, where possible?
> I've been trying to avoid dealing with const if at all
> possible, because it will make the type checking code
> considerably more complicated. But I haven't entirely
> ruled it out.
Ah, ok. I figured it would simply be a matter of tracking whether
something is const. Would there be more required than that?

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20080325/8cb492cf/attachment.bin 


More information about the Pyrex mailing list