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

Does not compile with gcc 4.6.2 #10

Open
vadim-skorba opened this issue Feb 7, 2012 · 8 comments
Open

Does not compile with gcc 4.6.2 #10

vadim-skorba opened this issue Feb 7, 2012 · 8 comments

Comments

@vadim-skorba
Copy link

Hi, Valery

I've tried to compile other nginx versions (1.0.11 - 1.1.15) on server with gcc 4.6.2 with last (125fa2e) version of that module and it was failed with such errors:

../nginx-eval-module/ngx_http_eval_module.c: In function ‘ngx_http_eval_block’:
../nginx-eval-module/ngx_http_eval_module.c:640:39: error: variable ‘pclcf’ set but not used [-Werror=unused-but-set-variable]
../nginx-eval-module/ngx_http_eval_module.c:631:32: error: variable ‘ecf’ set but not used [-Werror=unused-but-set-variable]
The problem is - new gcc becomes smarter and for now unused variables throws warnings. Nginx default config is:
-Werror=unused-but-set-variable]
BTW, with gcc 4.5.2 all was compiled successfully.
So, it would be great to fix module instead of changing nginx default options.

Thank you!
Vadim.

@jnbdz
Copy link

jnbdz commented May 16, 2013

I ask the question in ServerFault (http://serverfault.com/questions/507909/getting-a-build-error-when-installing-a-nginx-eval-module/507916?noredirect=1). They told me to remove the -Werror in objs/Makefile. So I did... And now it works. But I am not sure this is best thing to do.

@vadim-skorba as it work for you? Have you been able to make eval work?

@vadim-skorba
Copy link
Author

Yes, I compiled this module after fixing of source. You can just comment out warnings. There defined pclcf and ecf variables, but not used.
See ngx_http_eval_module.c:640:39 and ngx_http_eval_module.c:631:32
Comment out definitions by using /* */ and you'll be able to compile it.
Suppress warnings will work too, but it could lead to problems in other parts of code.

@jnbdz
Copy link

jnbdz commented May 16, 2013

Yes, I have not been able to use eval for some reason. Could that be the problem?

@jnbdz
Copy link

jnbdz commented May 17, 2013

I am confused. Where is ngx_http_eval_module.c:640:39 and ngx_http_eval_module.c:631:32?

640, and 631 indicate what? Also 39, and 32 indicate what exactly?

@vadim-skorba
Copy link
Author

That's filename.c:linenumber:column

@jnbdz
Copy link

jnbdz commented May 17, 2013

Sorry, I made a mistake. I had a very old version of nginx eval module. This was the reason of the confusion.

But I am still getting errors even after doing what you said:

/root/src/nginx-eval-module/ngx_http_eval_module.c: In function ‘ngx_http_eval_block’:
/root/src/nginx-eval-module/ngx_http_eval_module.c:675:5: error: ‘ecf’ undeclared (first use in this function)
/root/src/nginx-eval-module/ngx_http_eval_module.c:675:5: note: each undeclared identifier is reported only once for each function it appears in
/root/src/nginx-eval-module/ngx_http_eval_module.c:677:5: error: ‘pclcf’ undeclared (first use in this function)
make[1]: *** [objs/addon/nginx-eval-module/ngx_http_eval_module.o] Error 1
make[1]: Leaving directory `/root/src/nginx-1.2.7'
make: *** [build] Error 2

@jnbdz
Copy link

jnbdz commented May 17, 2013

It all works now. Thanks for the help.

I just needed to comment out ngx_http_eval_module.c:675:5 and ngx_http_eval_module.c:675:5.

@vkholodkov
Copy link
Owner

The latest change should fix it, I hope.

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

3 participants