数据库
MySQL
ORACLE
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
Linux运维
中间件
shell脚本
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
首页 动态 发帖 版块 我的
 退出
游客  
等级:
金豆:
经验:
首页  /  linux运维  /  linux服务  /  正文

nginx编译报错src/core/ngx_murmurhash.c:37:11: 错误:this statement may fall through [-Werror=implicit-fallthrough=] h ^= data[2]

  3212 
 0
 4
报错信息如下

make -f objs/Makefile
make[1]: 进入目录“/opt/nginx-1.8.1”
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
        -o objs/src/core/ngx_murmurhash.o \
        src/core/ngx_murmurhash.c
src/core/ngx_murmurhash.c: 在函数‘ngx_murmur_hash2’中:
src/core/ngx_murmurhash.c:37:11: 错误:this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[2] << 16;
         ~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: 附注:here
     case 2:
     ^~~~
src/core/ngx_murmurhash.c:39:11: 错误:this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[1] << 8;
         ~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: 附注:here
     case 1:
     ^~~~
cc1:所有的警告都被当作是错误
make[1]: *** [objs/Makefile:431:objs/src/core/ngx_murmurhash.o] 错误 1
make[1]: 离开目录“/opt/nginx-1.8.1”
make: *** [Makefile:8:build] 错误 2

原因:将警告当成错误处理

解决错误1:进入到nginx-1.6.3目录下(解压的目录)

找到当前目录下找到objs文件夹,并进入,打开文件Makefile,找到有一下内容的这行:

[root@lnmp nginx-1.8.1]# vim objs/Makefile
CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g 

-Werror: gcc将所有的警告当成错误进行处理把这行内容中的 “-Werror”去掉

标签:
作者签名:    楼主  2020-09-18 11:25:25

点赞推荐

回复列表
合作伙伴:
Powered by 运维术 8.3.2
© 2017-2024 模板 by 黑衣人
您的IP: 3.128.200.110 , 2024-09-08 03:21:36
Powered by 运维术 8.3.2
© 2017-2024 模板 by 黑衣人
(4) 分享
分享
取消
我的客服