我可以将警告限制为我的项目包含而不是 llvm 或 gcc 的所有包含吗?
我想限制项目包含的某些警告,因此不检查系统包含。那么:
/* I want no warnings from this include */
#include <myheader.h>
/* I want warnings from this include */
#include "myotherheader.h"
这对于 llvm 和/或 gcc 来说可能吗?
问候, 约亨
I would like to restrict certain warnings to project includes, so system includes are not checked. So:
/* I want no warnings from this include */
#include <myheader.h>
/* I want warnings from this include */
#include "myotherheader.h"
Is this possible with llvm and/or gcc?
Regards,
Jochen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GCC 已经这样做了 - 如果您有一些想要抑制警告的标头,您可以指定其他目录被视为“系统目录”:
我不太了解 llvm/clang,但自从 clang 有了一个选项
-Wsystem-headers
,启用来自系统标头的警告,我认为它对系统标头执行类似于 GCC 的操作(即,抑制它们的警告)。GCC already does this - you can specify additional directories to be considered as 'system directories' if you have some headers that you want to suppress warnings for:
I don't really know about llvm/clang, but since clang has an option,
-Wsystem-headers
, to enable warnings from system headers I'd assume it does something similar to GCC for system headers (i.e., suppress warnings for them).