VS17 Intellisense 对许多 WxWidgets 头文件中的“引用 NULL 指针”发出警告

问题描述 投票:0回答:1

我是 wxWidgets 的新手。 我习惯了 C++,但对 C++ 不太擅长,这足以帮助我作为机械工程师的工作。

我从 VS17 收到这些警告,主要是关于延迟 NULL 点 m_node。

Warning C6011   Dereferencing NULL pointer 'm_node'.    window.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    any.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    dataobj.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    gdicmn.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    list.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    list.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    menu.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    menu.h
Warning C26495  Variable 'wxModule::m_state' is uninitialized. Always initialize a member variable (type.6).    module.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    gdiimage.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    sizer.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    tbarbase.h
Warning C6011   Dereferencing NULL pointer 'm_node'.    variant.h

我尝试从 wxwidgets 库中隔离项目文件,但它们似乎是持久的。 我编译代码并运行它们没有问题。 当我在“Built+IntelliSense”上设置错误列表时,IntelliSense 也会生成此警告。

它正在对错误列表进行聚类,我想关闭来自 IntelliSense 的警告并仅依赖于构建。 但是我不确定这是一个好习惯,除非这是 wxWidgets 库的一个已知问题,并且我只需要接受它们并仅依赖于构建。

我可以接受这方面的教育吗?

c++ wxwidgets
1个回答
0
投票

这些是代码分析警告,无害,其中许多只是误报。 wxWidgets 标头在最大警告级别上编译时没有真正的(编译器)警告,但是如果您使用代码分析,则必须排除它们,抑制所有虚假警告是不值得的。

© www.soinside.com 2019 - 2024. All rights reserved.