gpt4 book ai didi

运行多个作业时,编译器会发出警告 clobber

转载 作者:行者123 更新时间:2023-11-30 14:49:39 26 4
gpt4 key购买 nike

我正在 Windows 上运行具有多个作业 (-j4) 的 make。在构建结束时,我让 Jenkins 抓取控制台日志并收集编译器警告的数量和类型。问题(我认为)是多个 make 作业都具有相同的标准输出,因此偶尔(比您想象的要少)一个作业的输出会被另一作业的输出破坏。例如:

ctc W549: D:\path\to\filename.c 10000/3 condition is always true
ctc W549: D:\path\to\file^ctc W588: D:\path\to\somefile.c dead assignment eliminated
name.c 10000/3 condition is always true

在上面的第 2 行中,我在一个警告被截断的地方插入了一个插入符号。第 3 行应该位于第 2 行插入符号之后。

似乎这些作业都在不同时间将其标准输出缓冲区刷新到控制台;有什么办法可以缓解这种情况吗?问题是警告刮刀在处理部分损坏的线路时遇到了麻烦。

一种选择是使用 -j1,但如果可能的话,我想继续利用多核。

最佳答案

使用--output-sync选项。此功能是在 GNU Make 4.0 版本中添加的。

根据 GNU Make manual :

--output-sync[=type]

Ensure that the complete output from each recipe is printed in one uninterrupted sequence. This option is only useful when using the --jobs option to run multiple recipes simultaneously (see Parallel Execution) Without this option output will be displayed as it is generated by the recipes.

关于运行多个作业时,编译器会发出警告 clobber,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49418008/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com