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

C arrays as state variables does not work as expected #2258

Open
erlingrj opened this issue Apr 11, 2024 · 1 comment
Open

C arrays as state variables does not work as expected #2258

erlingrj opened this issue Apr 11, 2024 · 1 comment
Labels
c Related to C target documentation
Milestone

Comments

@erlingrj
Copy link
Collaborator

erlingrj commented Apr 11, 2024

main reactor {
 state arr: int[100]
}

Here I would expect to have an int[100] field on the self-struct, but what is code generated is just an int*. If you initialize it, then it will work because the pointer is pointed at a global variable (static to the trigger_initialize function)

At least we should document this.

@erlingrj erlingrj added c Related to C target documentation labels Apr 11, 2024
@edwardalee
Copy link
Collaborator

This feels like a bug to me.

@lhstrh lhstrh added this to the 0.8.0 milestone May 17, 2024
@cmnrd cmnrd modified the milestones: 0.8.0, 0.9.0 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c Related to C target documentation
Projects
None yet
Development

No branches or pull requests

4 participants