server.c: In function ‘writeCommandsDeniedByDiskError’:
server.c:3934:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
server.c: In function ‘iAmMaster’:
server.c:5134:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make[1]: *** [server.o] Error 1
make[1]: Leaving directory `/opt/redis-6.0.9/src'
make: *** [all] Error 2
问题分析及解决:
Redis官网下载版本为 6.0.9
make报错是因为gcc版本过低,yum安装的gcc是4.8.5的。
所以需要升级gcc,升级过程如下:
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile
gcc -v