为什么我会收到错误“...取决于未初始化的值”在 valgrind 输出中?
如何抑制 valgrind 输出中的此错误?
==16727== 1 errors in context 2 of 18:
==16727== Conditional jump or move depends on uninitialised value(s)
导致此错误的原因是什么?我可以忽略它吗?
How can I suppress this error in valgrind's output?
==16727== 1 errors in context 2 of 18:
==16727== Conditional jump or move depends on uninitialised value(s)
What causes this error? Can I just ignore it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这意味着您的控制路径之一是这样的:当该控制路径执行时,变量/数据不会被初始化。单位化变量通常会导致未定义的行为,因此 valgrind 会检测到它并报告它。
看看这个,它会帮助你理解错误。
另外,将标志
--track-origins=yes
添加到 valgrind,它将为您提供有关未初始化数据源的信息。It means that one of your control path is such that an variable/data does not get initialized when that control path gets executed. Unitialized variables usually result in Undefined Behavior So valgrind detects it and reports it.
Have a look at this, It shall help you understand the error.
Also, add the flag
--track-origins=yes
to valgrind and it will give you information on the sources of uninitialised data.