[Vala] Pre Increment
- From: "Clément DAVID" <c david86 gmail com>
- To: vala paldo org
- Subject: [Vala] Pre Increment
- Date: Mon, 20 Aug 2007 10:19:44 +0100
Vala make a wrong translation to C of:
public class PreInc {
public static int main(string[] args)
{
int i=0;
int m = 5;
do {
stdout.printf("%d\n",i);
}
while(++i < m); }
}
for the while the C generated code is :
do {
fprintf (stdout, "%d\n", i);
} while (i = i + 1 < m);
in this case the program finished by a Segmentation Fault. Whereas in "while( ++i < m);" the program works
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]