enable -Werror=unused-result Browse files Inspired by https://git.lix.systems/lix-project/lix/commit/010ff57ebb40f1a9aaff99867d2886f0e59f774a From the original PR: > We do not have any of these warnings appearing at the moment, but > it seems like a good idea to enable [[nodiscard...
[ 133s] execpipe.cc:81:38: error: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Werror=unused-result] [ 133s] system("ls -l /proc/$$/task/ >&2"); [ 133s] ^ [ 133s] cc1plus: all warnings being treated as errors ...
提供解决expression result unused [-werror,-wunused-value]错误的方法 检查并移除冗余的表达式:仔细检查代码,找出并移除那些计算了结果但未使用的表达式。 修正逻辑错误:如果警告是由于逻辑错误导致的,需要修正代码逻辑,确保每个计算结果都被正确使用。 清理调试代码:如果代码中包含了调试用的临时表达式或打印语句,确保在...
rwpng.c:85:5: warning: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 85 | fread(sig, 1, 8, infile); | ^~~~ In file included from pngnq.c:99: neuquant32.h:59:22: warning: ‘biasvalue’ declared ‘static’ but never defined [...
解决: -Wno- 加上对应的变量或参数类型,即可忽略当前警告,编译通过。 例: [-Wunused-parameter] 变成 -Wno-unused-parameter 例: [-Werror,-Wsign-compare] 变成 -Wno-sign-compare LOCAL_CFLAGS+=-Wno-unused-const-variable \-Wno-null-conversion \-Wno-unused-variable \-Wno-unused-parameter \-Wno-un...
comapi.c:425:15: 错误:变量‘status’被设定但未被使用 [-Werror=unused-but-set-variable] isc_result_t status; ^ comapi.c: 在函数‘dhcp_control_signal_handler’中: comapi.c:514:25: 错误:变量‘control’被设定但未被使用 [-Werror=unused-but-set-variable] ...
Although these warnings will not result in compilation failure, often-Wallis used in conjunction with-Werrorand as a result, new warnings are turned into new errors. To fix, first see if the unused variable or parameter can be removed without changing the result or logic of the surrounding c...
>> attribute warn_unused_result [-Wunused-result] >> cc1: some warnings being treated as errors >> make[4]: *** [linc.lo] Error 1 > > The full build log is available from: > >http://people.debian.org/~lucas/logs/2013/05/09/orbit2_2.14.19-0.1_unstable.log> ...
/home/jello/openwrt/build_dir/target-aarch64_generic_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:249:3: warning: ignoring return value of 'system', declared with attribute warn_unused_result [-Wunused-result] system("cp -a /tmp/root/upper/* / 2>/dev/null"); ...
'-Werror=unused-result', 26 changes: 13 additions & 13 deletions 26 src/libexpr/json-to-value.cc Original file line numberDiff line numberDiff line change @@ -80,86 +80,86 @@ class JSONSax : nlohmann::json_sax<json> { public: ...