GNOME Bugzilla – Bug 725501
No way to specify annotations for virtual methods
Last modified: 2018-02-08 12:27:41 UTC
Virtual methods such as the GcrCertificate get_der_data() cannot be correctly annotated, and do not take their annotations from the accompanying accessor function either. The function in question is here: https://git.gnome.org/browse/gcr/tree/gcr/gcr-certificate.h#n48 The accessor is here: https://git.gnome.org/browse/gcr/tree/gcr/gcr-certificate.c#n395 This is the <virtual-method> that's generated, with an wrong <return-value> <virtual-method name="get_der_data"> <return-value transfer-ownership="none"> <type name="guint8" c:type="const guint8*"/> </return-value> <parameters> <instance-parameter name="self" transfer-ownership="none"> <type name="Certificate" c:type="GcrCertificate*"/> </instance-parameter> <parameter name="n_data" transfer-ownership="none"> <type name="gsize" c:type="gsize*"/> </parameter> </parameters> </virtual-method> This is the <method> that's generated, with a wrong <return-value>: <method name="get_der_data" c:identifier="gcr_certificate_get_der_data"> <doc xml:space="preserve">Gets the raw DER data for an X.509 certificate.</doc> <return-value transfer-ownership="none"> <doc xml:space="preserve">raw DER data of the X.509 certificate</doc> <array length="0" zero-terminated="0" c:type="guint8*"> <type name="guint8" c:type="guint8"/> </array> </return-value> <parameters> <instance-parameter name="self" transfer-ownership="none"> <doc xml:space="preserve">a #GcrCertificate</doc> <type name="Certificate" c:type="GcrCertificate*"/> </instance-parameter> <parameter name="n_data" direction="out" caller-allocates="0" transfer-ownership="full"> <doc xml:space="preserve">a pointer to a location to store the size of the resulting DER data.</doc> <type name="gsize" c:type="gsize*"/> </parameter> </parameters> </method>
I thought at one point I was able to explicitly annotate vfunc, something like: /** * GcrCertificateIface::get_der_data: * * Returns: (array length=n_data): */ const guchar * (*get_der_data) (GcrCertificate *self, gsize *n_data); Or at least I thought it was working in my patch for bug 693393. In any event it seems unfortunate to have to annotate both the vfunc and accessor.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/109.