After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 614097 - [ReturnsModifiedPointer] doesn't work well with inheritance
[ReturnsModifiedPointer] doesn't work well with inheritance
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-27 12:47 UTC by Sebastian Dröge (slomo)
Modified: 2018-05-22 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer: Don't use the accessor method when accessing Gst.Pad:caps property (1.61 KB, patch)
2010-03-27 12:48 UTC, Sebastian Dröge (slomo)
rejected Details | Review
codegen: Try to fix [ReturnsModifiedPointer] method calls from subclasses (1.22 KB, patch)
2010-03-27 12:48 UTC, Sebastian Dröge (slomo)
none Details | Review

Description Sebastian Dröge (slomo) 2010-03-27 12:47:46 UTC
public class A {
  [ReturnsModifiedPointer]
  public void do_something ();
}

public class B : A {}

A call to B.do_something() now produces the following C code:

(A *) b = a_do_something ((A *) b);


This obviously doesn't compile. Attached is a patch that makes it compilable at least but a cast is missing now to prevent a compiler warning. Also it feels a bit fragile :)
Comment 1 Sebastian Dröge (slomo) 2010-03-27 12:48:36 UTC
Created attachment 157276 [details] [review]
gstreamer: Don't use the accessor method when accessing Gst.Pad:caps property

Gst.Pad.get_caps() returns something completely different than the caps
property.

Fixes bug #608005.
Comment 2 Sebastian Dröge (slomo) 2010-03-27 12:48:42 UTC
Created attachment 157277 [details] [review]
codegen: Try to fix [ReturnsModifiedPointer] method calls from subclasses
Comment 3 Sebastian Dröge (slomo) 2013-07-17 11:45:04 UTC
Ping? :) Probably can be closed as obsolete nowadays.
Comment 4 Evan Nemerson 2014-06-27 03:50:57 UTC
ReturnsModifiedPointer is really not supposed to be used in Vala code--it's only for bindings.

We should just emit an error message if someone tries to use it instead of generating invalid C.
Comment 5 GNOME Infrastructure Team 2018-05-22 13:31:13 UTC
-- 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/vala/issues/79.