gpt4 book ai didi

c++ - 使用 cppcheck 进行多行抑制

转载 作者:行者123 更新时间:2023-11-28 04:12:49 30 4
gpt4 key购买 nike

我想在 cppcheck 中使用多行抑制。那可能吗?例如:我要改变

// cppcheck-suppress unusedFunction
int fn1(){
return 42;
}
// cppcheck-suppress unusedFunction
int fn2(){
}
// cppcheck-suppress unusedFunction
int fn3(){
}
int main(){
}

类似于:

// cppcheck-suppress-start unusedFunction
int fn1(){
return 42;
}
int fn2(){
}
int fn3(){
}
// cppcheck-suppress-end unusedFunction
int main(){
}

最佳答案

没有;每the manual ,内联抑制没有“开始”/“结束”等效语法。

但是,还有其他方法可以设置抑制;例如,如果您想在整个源文件中使用 unusedFunction,您可以在抑制文件中这样说。

请参阅上述链接手册中的第 6 章。

关于c++ - 使用 cppcheck 进行多行抑制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57325888/

30 4 0
文章推荐: c++ - 解壳 C++ : Transform multiple variable initialization per line posible?
文章推荐: html - 在 Bootstrap 中获取响应式全宽图像
文章推荐: css -
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com