[Vala] string parameter in static function
- From: lariamat <interflug1 gmx net>
- To: Mailing List Vala <vala-list gnome org>
- Subject: [Vala] string parameter in static function
- Date: Thu, 04 Dec 2008 01:18:44 +0100
I get a strange c compilation warning when using a string as parameter
in a static function. When i forward the string to another string
everything is OK.
(In my program I get this warning from a Gst.TagForeachFunc.)
I am using vala 0.5.2 but I also had this warning in previous versions.
Here are two testcases. The first is giving the warning, the second not.
FIRST:
------------------------------------------
public static void function_1(int i, string a_string) {
switch (a_string) {
case "lalala_1":
print("lalala_1\n");
break;
default:
print("default case\n");
break;
}
}
public static int main (string[] args) {
function_1(1, "lalala_1");
return 0;
}
------------------------------------------
SECOND:
------------------------------------------
public static void function_1(int i, string a_string) {
string x = a_string;
switch (x) {
case "lalala_1":
print("lalala_1\n");
break;
default:
print("default case\n");
break;
}
}
public static int main (string[] args) {
function_1(1, "lalala_1");
return 0;
}
------------------------------------------
Is this a bug or am I getting something wrong?
Regards
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]