原 src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthroug
版权声明:本文为博主原创文章,请尊重他人的劳动成果,转载请附上原文出处链接和本声明。
本文链接:https://www.91mszl.com/zhangwuji/article/details/1286
场景:在阿里云centos 8 下安装nginx-1.9.0 报错如下:
src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[2] << 16;
~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
case 2:
^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[1] << 8;
~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
case 1:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:445: objs/src/core/ngx_murmurhash.o] Error 1
make[1]: Leaving directory '/usr/local/java/nginx-1.9.9'
make: *** [Makefile:8: build] Error 2
[root@iZuf6bhe673f5qtkz6pwjuZ nginx-1.9.9]#
解决办法:
找到目录:/usr/local/java/nginx-1.9.0/objs/Makefile 文件,去掉里面的 -Werror 即可。
更改前:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g
更改后:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused -g
2020-12-01 12:21:19 阅读(2294)
名师出品,必属精品 https://www.91mszl.com
博主信息