Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling static recursive functions fails with "internal error: runOnce action depends on itself" #150

Open
albel727 opened this issue May 24, 2017 · 2 comments

Comments

@albel727
Copy link

albel727 commented May 24, 2017

The following is literally enough to trigger the error:

static void kill(void) {
    kill();
}
void main(void) {
    kill();
}

Just removing the static qualifier produces the expected result.
Not calling kill() function from non-static functions such as main() also helps, but of course then kill() is not translated to rust at all.
Ping-pong style recursion works as long as one of the functions in the cycle is not static, i.e. the following works.

static void kill2(void);

void kill1(void) {
    kill2();
}

static void kill2(void) {
    kill1();
}

void main(void) {
    kill2();
}
@ddugovic
Copy link

I'm attempting to translate tree.c and I'd prefer this were a warning rather than an error.

@KamilaBorowska
Copy link

This happens even when a function is not called.

static a() { a; }
b() { a; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants