Re: [Vala] code does not compile with 0.13.2+, did with 0.13.1



Hello,

some days ago I posted this issue: code that compiles with vala 0.13.1
but not with 0.13.2 or 0.13.3.

Should I open a bug report?

Thanks,
Iñigo



2011/9/1 Iñigo Serna <inigoserna gmail com>:
Hi,

attached is a minimal example.
In order to compile it you would need a proper cross-compiler
environment and the native libraries so I understand it's not
possible.
Anyway I've included both .c files, the .vapi and the lib include files.

Thanks again,
Iñigo


2011/9/1 Iñigo Serna <inigoserna gmail com>:
Hello,

I have some code that compiled ok with 0.13.1 but which doesn't
compile with 0.13.2 or 0.13.3
I also noted that new .c files are bigger, with many more temp vars

My code is a bit complex, bindings of some libs for an e-ink device.
In fact I'm using an ARM cross-compiler from a x86_64 linux machine.


This is how I run the vala:

$ valac --vapidir=../irex --pkg=gtk+-2.0 --pkg=gdk-x11-2.0
--pkg=gconf-2.0 --pkg=liberipc --pkg=posix --pkg=sqlite3 --pkg=MyUtils
--cc=arm-poky-linux-gnueabi-gcc -X -mcpu=arm1136jf-s -X
-mtune=arm1136jf-s -X -O3  --enable-experimental --save-temps
navigator.vala ../irex/irex.vala ../irex/irexplus.vala -o navigator

and the errors:
[...]
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_get_battery_state’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:654: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:654: error: (Each
undeclared identifier is reported only once
/home/devel/mine/ereader/dr-vala/navigator/irex.c:654: error: for each
function it appears in.)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:654: error: expected
‘;’ before ‘_tmp4_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:658: error: expected
‘;’ before ‘_tmp8_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:665: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:667: error: ‘_tmp4_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:670: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:672: error: ‘_tmp8_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_on_menu_item’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:715: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:715: error: expected
‘;’ before ‘_tmp3_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:722: error: expected
‘;’ before ‘_tmp9_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:729: error: expected
‘;’ before ‘_tmp15_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:736: error: expected
‘;’ before ‘_tmp21_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:745: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:747: error: ‘_tmp3_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:752: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:754: error: ‘_tmp9_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:759: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:761: error:
‘_tmp15_’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:766: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:768: error:
‘_tmp21_’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_on_window_activated’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:785: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:785: error: expected
‘;’ before ‘_tmp3_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:796: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:798: error: ‘_tmp3_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_on_window_deactivated’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:814: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:814: error: expected
‘;’ before ‘_tmp3_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:825: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:827: error: ‘_tmp3_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_on_file_open’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:843: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:843: error: expected
‘;’ before ‘_tmp3_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:861: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:863: error: ‘_tmp3_’
undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c: In function
‘irex_ipc_on_file_close’:
/home/devel/mine/ereader/dr-vala/navigator/irex.c:889: error:
‘liberipcArgString’ undeclared (first use in this function)
/home/devel/mine/ereader/dr-vala/navigator/irex.c:889: error: expected
‘;’ before ‘_tmp3_’
/home/devel/mine/ereader/dr-vala/navigator/irex.c:902: warning:
assignment discards qualifiers from pointer target type
/home/devel/mine/ereader/dr-vala/navigator/irex.c:904: error: ‘_tmp3_’
undeclared (first use in this function)
[...]
error: cc exited with status 256
Compilation failed: 1 error(s), 11 warning(s)
make: *** [navigator] Error 1


I've attached library .h files, the .vapi file, the .vala file using
the lib, and 3 of the generated C files (using vala versions 0.13.1,
0.13.2. and 0.13.3. Note 0.13.2. and 0.13.3 generate same .c file).


The C generated function for the first error:

VALA 0.13.1 C code:
===============
void irex_ipc_get_battery_state (irexIPC* self, gint* level, gchar** state) {
   gint _level = 0;
   gchar* _state = NULL;
   eripc_event_info_t* info = NULL;
   eripc_event_info_t* _tmp0_ = NULL;
   gchar* _tmp1_;
   g_return_if_fail (self != NULL);
   eripc_send_varargs_and_wait (self->context, &_tmp0_,
ERIPC_BUS_SESSION, "com.irexnet.sysd", "sysGetBatteryState",
ERIPC_TYPE_INVALID, NULL);
   info = _tmp0_;
   _level = (gint) info->args[0].value.s;
   _tmp1_ = g_strdup ((const gchar*) info->args[1].value.s);
   _g_free0 (_state);
   _state = _tmp1_;
   if (level) {
       *level = _level;
   }
   if (state) {
       *state = _state;
   } else {
       _g_free0 (_state);
   }
}



VALA 0.13.2 C code:
===============
void irex_ipc_get_battery_state (irexIPC* self, gint* level, gchar** state) {
   gint _vala_level = 0;
   gchar* _vala_state = NULL;
   eripc_event_info_t* info = NULL;
   eripc_context_t* _tmp0_;
   eripc_event_info_t* _tmp1_ = NULL;
   eripc_arg_t* _tmp2_;
   eripc_arg_t _tmp3_;
   liberipcArgString _tmp4_;
   gchar* _tmp5_;
   eripc_arg_t* _tmp6_;
   eripc_arg_t _tmp7_;
   liberipcArgString _tmp8_;
   gchar* _tmp9_;
   gchar* _tmp10_;
   g_return_if_fail (self != NULL);
   _tmp0_ = self->context;
   eripc_send_varargs_and_wait (_tmp0_, &_tmp1_, ERIPC_BUS_SESSION,
"com.irexnet.sysd", "sysGetBatteryState", ERIPC_TYPE_INVALID, NULL);
   info = _tmp1_;
   _tmp2_ = info->args;
   _tmp3_ = _tmp2_[0];
   _tmp4_ = _tmp3_.value;
   _tmp5_ = _tmp4_.s;
   _vala_level = (gint) _tmp5_;
   _tmp6_ = info->args;
   _tmp7_ = _tmp6_[1];
   _tmp8_ = _tmp7_.value;
   _tmp9_ = _tmp8_.s;
   _tmp10_ = g_strdup ((const gchar*) _tmp9_);
   _g_free0 (_vala_state);
   _vala_state = _tmp10_;
   if (level) {
       *level = _vala_level;
   }
   if (state) {
       *state = _vala_state;
   } else {
       _g_free0 (_vala_state);
   }
}





ArgString is defined in liberipc.vapi but vala 0.13.1 didn't use it,
0.13.2 does use it and many temp variables.


Any idea?

Thanks,
Iñigo Serna




--
Iñigo Serna
Katxijasotzaileak




-- 
Iñigo Serna
Katxijasotzaileak



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]