当前位置: 首页 > 工具软件 > ngx_cc > 使用案例 >

[安装fastfds中的nginx执行make命令报错]src/core/ngx_murmurhash.c:37:11: error

芮雪风
2023-12-01

问题

在nginx文件夹里执行make命令报错

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:
     ^~~~

解决

修改Makefile文件,将Werror字样去掉

[root@localhost fastdfs]# vim ./nginx-1.8.0/objs/Makefile
CC =    cc
CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused Werror -g  -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='"/etc/fdfs/mod_fastdfs.conf"'

修改ngx_user.c文件,将cd.current_salt[0] = ~salt[0]注释掉

    /* work around the glibc bug */
   /* cd.current_salt[0] = ~salt[0]; */
 类似资料: