GNOME Bugzilla – Bug 615890
warn when there's an arg annotation that doesn't match the function definition
Last modified: 2015-02-07 16:52:07 UTC
In this block: /** * test_cairo_surface_full_out: * @out: (out) (transfer full): */ void test_cairo_surface_full_out (cairo_surface_t **out) the annotation for the out arg is ignored. If I change 'out' to 'surface', it works: /** * test_cairo_surface_full_out: * @surface: (out) (transfer full): */ void test_cairo_surface_full_out (cairo_surface_t **surface)
Looks like 'array' is another reserved word which will cause annotations to be silently dropped.
Actually, what i think was going on is that the function definition had a different name for that arg. What we should do is warn that the annotation refers to an arg that is not in the function declaration
Created attachment 159780 [details] [review] Warn about annotations for unknown args
Review of attachment 159780 [details] [review]: Looks good with the changes mentioned above. ::: giscanner/annotationparser.py @@ +498,3 @@ + def _check_arg_annotations(self, parent, params, block): + if block is not None: Invert + return to reduce indentation @@ +502,3 @@ + if tag == TAG_RETURNS: + continue + found = False This python pattern is nicer: for n in ns: if cond: break else: return # code only called when break was invoked. @@ +507,3 @@ + found = True + break + if not found: and add else: return here
The following fix has been pushed: 24711bc Warn about annotations for unknown args
Created attachment 159785 [details] [review] Warn about annotations for unknown args
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]