报错:argument ‘nret’ might be clobbered by ‘longjmp’ or ‘vfork’

173 views
Skip to first unread message

jacky

unread,
Apr 18, 2013, 11:27:23 PM4/18/13
to openresty
编译lua-nginx-module出现错误:
modules/lua-nginx-module/src/ngx_http_lua_util.c: In function ‘ngx_http_lua_run_thread’:
modules/lua-nginx-module/src/ngx_http_lua_util.c:976:34: error: argument ‘nret’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_lua_util.o] Error 1

环境:gcc version 4.7.3,nginx-1.2.7  ubuntu 13.04, lua_nginx_module 是 18日的 HEAD 版本

哪个大牛帮忙看看,这种情况如何解决呢?谢谢

Jacky

unread,
Apr 19, 2013, 2:03:52 AM4/19/13
to open...@googlegroups.com
������������һ�½����������ţ��Ҳָ��һ���Ƿ�������⡫��

���������
------------------------------------------
diff lua-nginx-module/src/ngx_http_lua_util.c  lua-nginx-module/src/ngx_http_lua_util.c.1

976c976
<     ngx_http_lua_ctx_t *ctx, int nret)
---
>     ngx_http_lua_ctx_t *ctx, volatile int nret)

����int nret ���� volatile (����?����?��֪����ô������������C...)
-------------------------------------------

�ο���ַ�� http://blog.chinaunix.net/uid-20564848-id-74765.html
��л��λͬѧ�IJ��͡�����

��Ϊ�DZ��ز��Ի��������Բ�֪���᲻��������Ӱ�죬�ܱ���ͨ�����л��л���ˡ���

On 04/19/2013 11:27 AM, jacky wrote:
����lua-nginx-module���ִ���

modules/lua-nginx-module/src/ngx_http_lua_util.c: In function ��ngx_http_lua_run_thread��:
modules/lua-nginx-module/src/ngx_http_lua_util.c:976:34: error: argument ��nret�� might be clobbered by ��longjmp�� or ��vfork�� [-Werror=clobbered]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_lua_util.o] Error 1

������gcc version 4.7.3��nginx-1.2.7  ubuntu 13.04, lua_nginx_module �� 18�յ� HEAD �汾

�ĸ���ţ��æ���������������ν���أ�лл
--
--
�ʼ������б?openresty��,ר���ڼ�������!
����: �뷢�հ��ʼ��� openresty...@googlegroups.com
����: �뷢�ʼ��� open...@googlegroups.com
�˶�: �뷢�ʼ��� openresty+...@googlegroups.com
�鵵: http://groups.google.com/group/openresty
����: http://openresty.org/
�ֿ�: https://github.com/agentzh/ngx_openresty
�̳�: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
 
 

agentzh

unread,
May 7, 2013, 3:55:11 PM5/7/13
to openresty
Hello!

2013/4/18 jacky:
很有意思,我在 Fedora Linux x86_64 上面从 gcc 4.7.3 官方源码包编译了一个 gcc,却无法复现你这里看到的警告。

看来 Ubuntu 13.04 上的 gcc 源码很可能被 Ubuntu 修改过了。我稍候再找一个 Ubuntu 的机器尝试一下,看看能否复现。

多谢报告!

Best regards,
-agentzh

agentzh

unread,
May 7, 2013, 8:09:39 PM5/7/13
to openresty
Hello!

2013/4/18 Jacky:
> 问题解决,分享一下解决方案,大牛们也指点一下是否会有问题~~
>
> 解决方法:
> ------------------------------------------
> diff lua-nginx-module/src/ngx_http_lua_util.c
> lua-nginx-module/src/ngx_http_lua_util.c.1
>
> 976c976
> < ngx_http_lua_ctx_t *ctx, int nret)
> ---
>> ngx_http_lua_ctx_t *ctx, volatile int nret)
>
> 即:int nret 增加 volatile (修饰?类型?不知道怎么描述。。不懂C...)

我刚刚已提交了一个类似的补丁,避免了 Ubuntu 上面 gcc 4.7.3 的这个警告:

https://github.com/chaoslawful/lua-nginx-module/commit/4806fc2

欢迎测试 :)

Best regards,
-agentzh
Reply all
Reply to author
Forward
0 new messages