簡體   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