centos-stream中安裝nginx遇到的問題一二

在centos-stream中安裝nginx-1.9.15時

遇到在make時遇到如下問題:

在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

CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g 


修改ngx_user.c文件,將cd.current_salt[0] = ~salt[0]註釋掉

/* work around the glibc bug */
/* cd.current_salt[0] = ~salt[0]; */

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章