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 772209 - [CCode(simple_generics = true)] generates invalid C code
[CCode(simple_generics = true)] generates invalid C code
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Generics
0.32.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-29 21:36 UTC by Matthias Berndt
Modified: 2018-05-22 15:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple attempt at fixing the bug (2.74 KB, patch)
2016-09-29 21:39 UTC, Matthias Berndt
none Details | Review
WIP (2.73 KB, patch)
2016-10-05 15:22 UTC, Rico Tzschichholz
none Details | Review

Description Matthias Berndt 2016-09-29 21:36:42 UTC
Hey,

when declaring a function e. g. like this:

[CCode(simple_generics = true)]
extern GLib.HashTable<K, V> g_hash_table_ref<K, V>(GLib.HashTable<K, V> ht);

The generated C prototype will look like this:
GHashTable* g_hash_table_ref (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashTable* ht);

But because of the simple_generics attribute, at the call site only a single argument (i. e. the hash table) will be passed. The resulting C code can not be compiled due to this.
Comment 1 Matthias Berndt 2016-09-29 21:39:15 UTC
Created attachment 336553 [details] [review]
simple attempt at fixing the bug
Comment 2 Rico Tzschichholz 2016-10-05 15:22:14 UTC
Created attachment 336994 [details] [review]
WIP

Hanlde simple_generics in more cases. This might not be possible though.
Comment 3 Matthias Berndt 2016-10-05 20:49:47 UTC
Hey Rico,

could you be a bit more specific? What is it that might not be possible?
Comment 4 Matthias Berndt 2017-01-07 14:34:37 UTC
Hey Rico,

what else do you think needs to be done to fix this bug?
Comment 5 GNOME Infrastructure Team 2018-05-22 15:39:26 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/557.