Re: [Vala] Pre Increment
- From: Raffaele Sandrini <raffaele sandrini ch>
- To: Ed Schouten <ed fxq nl>
- Cc: vala paldo org, Clément DAVID <c david86 gmail com>
- Subject: Re: [Vala] Pre Increment
- Date: Mon, 20 Aug 2007 16:51:09 +0200
On Mon, 2007-08-20 at 14:32 +0200, Ed Schouten wrote:
* Clément DAVID <c david86 gmail com> wrote:
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
Looks like Vala forgets to put braces around the statement.
Fixed in SVN.
Raffaele
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]