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

Define macro inside a function block will crash picoc #8

Open
jpoirier opened this issue Jun 13, 2015 · 0 comments
Open

Define macro inside a function block will crash picoc #8

jpoirier opened this issue Jun 13, 2015 · 0 comments

Comments

@jpoirier
Copy link
Owner

void printArray(void) {

define SIZE 10

int array[SIZE] = {5, 4, 3, 9, 1, 8, 6, 7, 5, 2};
printf("4: %d\n", array[4]);
}
printArray();

6907 segmentation fault

The following code will work:

define SIZE 10

void printArray(void) {
int array[SIZE] = {5, 4, 3, 9, 1, 8, 6, 7, 5, 2};
printf("4: %d\n", array[4]);
}
printArray();

Issue copied from: https://code.google.com/p/picoc/issues/detail?id=192 and
https://code.google.com/p/picoc/issues/detail?id=193

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

No branches or pull requests

1 participant