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 657262 - MarkupParser: problem with "*_target" struct members
MarkupParser: problem with "*_target" struct members
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GLib
0.13.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-24 16:10 UTC by Sébastien Wilmet
Modified: 2011-08-24 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2011-08-24 16:10:04 UTC
I think the problem is more general than simply a MarkupParser problem. But in my case, the problem occurs with MarkupParser.

-----

public static int main (string[] args) {
    MarkupParser parser = { null, null, null, null, null };
    return 0;
}

$ valac test.vala
test.vala:2.18-2.58: warning: local variable `parser' declared but never used
    MarkupParser parser = { null, null, null, null, null };
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/seb/programmation/vala/test.vala.c: In function ‘_vala_main’:
/home/seb/programmation/vala/test.vala.c:21: error: ‘GMarkupParser’ has no member named ‘start_element_target’
/home/seb/programmation/vala/test.vala.c:23: error: ‘GMarkupParser’ has no member named ‘end_element_target’
/home/seb/programmation/vala/test.vala.c:25: error: ‘GMarkupParser’ has no member named ‘text_target’
/home/seb/programmation/vala/test.vala.c:27: error: ‘GMarkupParser’ has no member named ‘passthrough_target’
/home/seb/programmation/vala/test.vala.c:29: error: ‘GMarkupParser’ has no member named ‘error_target’
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)

-----

The C code generated:

GMarkupParser _tmp0_ = {0};
GMarkupParser parser;
_tmp0_.start_element = NULL;
_tmp0_.start_element_target = NULL;
_tmp0_.end_element = NULL;
_tmp0_.end_element_target = NULL;
_tmp0_.text = NULL;
_tmp0_.text_target = NULL;
_tmp0_.passthrough = NULL;
_tmp0_.passthrough_target = NULL;
_tmp0_.error = NULL;
_tmp0_.error_target = NULL;
parser = _tmp0_;

-----

It's a regression in Vala 0.13, since with Vala 0.12 there is no problem.
Comment 1 Luca Bruno 2011-08-24 16:29:40 UTC
commit d08d49653c727bae5a510f30e2e6a308ae937b1a
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Wed Aug 24 18:27:05 2011 +0200

    glib-2.0: Fix MarkupParser bindings
    
    Fixes bug 657262.

Not a regression strictly speaking :) The bug is that it worked before.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.