Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在宏定义里检查指针失效 #30

Open
lycug opened this issue Jun 17, 2019 · 2 comments
Open

在宏定义里检查指针失效 #30

lycug opened this issue Jun 17, 2019 · 2 comments

Comments

@lycug
Copy link

lycug commented Jun 17, 2019

#define LogCheckPtrVoid(ptr, ...)
if(nullptr == ptr){
ERROR_LOG(VA_ARGS);
return;
}

有这样的一段宏定义,在程序其他地方调用的时候判断指针。但是扫描之后,后面使用该指针的时候,扫描工具会报空指针警告。

@ben620
Copy link
Collaborator

ben620 commented Jul 1, 2019

你好,应该是扫描的时候,宏没有正常展开。您可以在配置文件中添加一下配置cfg/cfg/xml文件
section JumpCode。

<jumpcode name="LogCheckPtrVoid"> <arg index="1"/> </jumpcode>

@iotLusian
Copy link

iotLusian commented Jun 17, 2022

你好,应该是扫描的时候,宏没有正常展开。您可以在配置文件中添加一下配置cfg/cfg/xml文件 section JumpCode。

<jumpcode name="LogCheckPtrVoid"> <arg index="1"/> </jumpcode>

您好!请问JumpCode的name部分是配置宏的名字吗?我可以使用JumpCode的name跳过函数或者变量么?期待您的回答,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants