我正在尝试制作
小代理服务器 tcproxy
:
user@localhost:tcproxy $ make
cd src && make all
make[1]: Entering directory '/home/user/Downloads/tcproxy/src'
CC anet.o
In file included from /usr/include/sys/types.h:25:0,
from anet.c:33:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^
cc1: all warnings being treated as errors
Makefile:26: recipe for target 'anet.o' failed
make[1]: *** [anet.o] Error 1
make[1]: Leaving directory '/home/user/Downloads/tcproxy/src'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
编译失败,因为所有警告都被视为错误
它已经两年没有更新了,警告似乎只是来自一些被弃用的东西,但我希望它仍然可以工作。
我用谷歌搜索了如何阻止所有警告被视为错误;有人建议使用 -Wno-error
但这对我的情况没有影响。
我怎样才能在这里强制编译?
注意
Makefile
只包含:
#
# tcproxy - Makefile
#
# Author: dccmx <dccmx@dccmx.com>
#
default: all
.DEFAULT:
cd src && $(MAKE) $@
最佳答案
在 src/Makefile
中有一行定义:
CFLAGS_GEN = -Wall -Werror -g $(CFLAGS)
删除 -Werror
并且您收到的警告应该被忽略。
关于c - 停止 make 将警告视为错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28884664/