March 24, 2005 Error: Access Violation | ||||
|---|---|---|---|---|
| ||||
Why the program produced from the following code enters loop which ends with the message: "Error: Access Violation"?
import std.c.stdio;
typedef u *u();
u *s()
{
static int x = 0;
printf("%d\n", x++);
return s;
}
int main(){
s();
return 0;
}
For the below code the compiler (v0.119) reports "Internal error:
..\ztc\cgcod.c 1445":
import std.c.stdio;
typedef u *u();
u s()
{
static int x = 0;
printf("%d\n", x++);
return s;
}
int main(){
s();
return 0;
}
Thank you,
Brian
| ||||
March 24, 2005 Re: Error: Access Violation | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Brian Gardner | I reposted the message because for some unknown reason(s) it didn't appear in my newsreader. In article <d1uemp$2a34$1@digitaldaemon.com>, Brian Gardner says... > >Why the program produced from the following code enters loop which ends with the message: "Error: Access Violation"? > >import std.c.stdio; > >typedef u *u(); > >u *s() >{ > static int x = 0; > printf("%d\n", x++); > return s; >} > >int main(){ > s(); > return 0; >} > >For the below code the compiler (v0.119) reports "Internal error: >..\ztc\cgcod.c 1445": > >import std.c.stdio; > >typedef u *u(); > >u s() >{ > static int x = 0; > printf("%d\n", x++); > return s; >} > >int main(){ > s(); > return 0; >} > >Thank you, >Brian > > | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply