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

Is there a problem with C99/C11? #30

Open
AntonioCS opened this issue Dec 27, 2015 · 6 comments
Open

Is there a problem with C99/C11? #30

AntonioCS opened this issue Dec 27, 2015 · 6 comments

Comments

@AntonioCS
Copy link

What is the issue with the int in the for loop declaration? Gcc and Clang both support C99 and C11.

@mzer0-yu
Copy link
Contributor

variable declared within for-loop is visible in the first following line since C11(C++ 11).
e.g.
for(int i=0; ;) {
}
i++;

BUT we are writing C.

@AntonioCS
Copy link
Author

C11 is C. The ability do declare and use variables in the for loop declaration simplifies code.

@ghost
Copy link

ghost commented Dec 27, 2015

With gcc, -std=c99 must be declared. Which was not specified in Makefile.

@mzer0-yu
Copy link
Contributor

OK. Changes will be added to dev branch.

@ghost
Copy link

ghost commented Dec 27, 2015

Great.

@AntonioCS
Copy link
Author

👍

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

2 participants