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

Should not use for loop declarations #628

Open
sergey-dryabzhinsky opened this issue Dec 21, 2021 · 0 comments
Open

Should not use for loop declarations #628

sergey-dryabzhinsky opened this issue Dec 21, 2021 · 0 comments

Comments

@sergey-dryabzhinsky
Copy link

sergey-dryabzhinsky commented Dec 21, 2021

gcc-4.8 in Ubuntu 14.04 fails in hiredis code with:

/home/sergey/debuild/nginx/nginx-1.20/nginx/nginx-1.20.2/debian/modules/http-nchan/src/store/redis/hiredis/read.c: In function ‘redisReaderFree’:
/home/sergey/debuild/nginx/nginx-1.20/nginx/nginx-1.20.2/debian/modules/http-nchan/src/store/redis/hiredis/read.c:646:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int i = 0; i < r->tasks; i++) {
         ^

I think that can be healed via CFLAGS declaration in config.
Just add these lines after have= ...:

CFLAGS="$CFLAGS -std=gnu99"

This should work fine with gcc-4.4+

Or move i declaration from loop if you're supporting hiredis code.

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

1 participant