Bet*_*ker 6 warnings g++ deprecated
We're using g++ 4.4.3, and one of our third-party libraries is causing the lovely error
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
Since it's a third-party library, I can't fix the problem, so I just want to tell the compiler to suppress this warning for the one H file that causes the problem.
I tried a few things with
#pragma GCC diagnostic ignored "-Wdeprecated"
Run Code Online (Sandbox Code Playgroud)
but I can't find which warning it is to specify (there is no "-Wdeprecated").
So is there any way I can suppress this warning just for the one offending H file? I'm hoping to do something like this:
// Turn off the warning
#pragma GCC diagnostic ignored "-Wdeprecated"
#include "BadFile.h"
// Turn the warning back on
#pragma GCC diagnostic warning "-Wdeprecated"
Run Code Online (Sandbox Code Playgroud)
我无法找到使用编译指示执行此操作的方法,只能通过在命令行上传递 -Wno-deprecated 来实现。所以,如果你绝望了,你可以尝试:
#undef __DEPRECATED
// include offensive headers here...
#define __DEPRECATED
Run Code Online (Sandbox Code Playgroud)
但请注意,我绝对不会容忍取消系统级别#defines :-P
| 归档时间: |
|
| 查看次数: |
2026 次 |
| 最近记录: |