繁体   English   中英

停止将警告视为错误

[英]Stop make from treating warnings as errors

我正在尝试make小代理服务器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

编译失败,因为all warnings are being treated as errors

它已经有两年没有更新了,看来警告只是来自不赞成使用的东西,但是我希望它仍然可以工作。

我已经搜索了如何停止将所有警告视为错误的警告; 有人建议使用-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 ,将忽略您收到的警告。

这些是编译器选项,不是make选项。

您需要找到在make调用编译器时使用的选项。 在makefile中查找选项-Werror ,然后将其从包含的任何变量中删除(可能是CFLAGS或某些变体)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM