Skip to content

Declaring variable outside the for loop #1186

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

Conversation

manishmalik
Copy link
Contributor

Hi,
This PR fixes the minor compile errors that I was getting while building libmodsecurity. I was getting the following error:

make[2]: Entering directory `/opt/ModSecurity/examples/multiprocess_c'
gcc -DHAVE_CONFIG_H -I. -I../../src    -I../../headers -I../..  -g -O2 -MT multi-multi.o -MD -MP -MF .deps/multi-multi.Tpo -c -o multi-multi.o `test -f 'multi.c' || echo './'`multi.c
multi.c: In function ‘process_request’:
multi.c:53:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < REQUESTS_PER_PROCESS; i++) {
     ^
multi.c:53:5: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [multi-multi.o] Error 1
make[2]: Leaving directory `/opt/ModSecurity/examples/multiprocess_c'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/ModSecurity/examples'
make: *** [all-recursive] Error 1

@zimmerle
Copy link
Contributor

Hi @manishmalik,

Thank you for the patch! Merged!

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

Successfully merging this pull request may close these issues.

2 participants