Deprecated Header warning (C++)
Deprecated Header warning (C++)
我一直收到已弃用的标头警告:
#ifdef __DEPRECATED
#warning This file includes at least one deprecated or antiquated header.
Please consider using one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.
#endif
然而,我没有看到我的项目调用任何不赞成的头文件(包括我的库调用的头文件)。这些是我正在加载的标题(或者,至少是我看到的标题):iostream
math.h
assert.h
fstream
vector
time.h
。
在第17.4.1.2 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf节中,只有应该使用的标头列表。
1)是否有一个已弃用的列表?
2)任何关于如何摆脱预处理器的想法哪一个是他不喜欢的确切头?
干杯!
来自C世界的标头必须以c
作为前缀,而不是后置。
这意味着您需要包含cmath
, cassert
和ctime
。
在这种情况下,只有头文件的名称是不可取的,而不是内容。
注意:您可以通过在您链接到的文档中匹配它们的名称来推断哪些标头受到这种弃用。
显然,这只适用于标准头文件。例如,unistd.h
将始终是unistd.h
。
相关文章:
- "Warning: Comma within array index expression"但逗号分隔函数参数
- 在 Cocos2dx 中初始化粒子效果后的警告 - "libpng warning: iCCP: known incorrect sRGB profile"
- Visual Studio C6385 warning c++
- "Warning : No return statement in function returning non-void"是什么意思?
- cuda-gdb 给出错误"warning: Cuda API error detected: cudaLaunchKernel returned (0x7)"
- 编译代码时"[Warning] extra tokens at end of"
- QT_HAS_BUILTIN warning
- warning C4503 with CGAL 4.12-beta 2
- 如何修复'PCH Warning: header stop not at file scope'
- 如何在 C++ 中修复"/usr/bin/ld: warning: liblber-2.4.so.2, needed by //usr/lib/x86_64-linux-gnu/libcurl-gnu
- BufferOverrun :codesonar warning
- Warning 6011 in C++
- 如何修复空虚拟方法的"warning: no return statement in function returning non-void [-Wreturn-type]"
- 为什么"Warning X4000: use of potentially uninitialized variable"显示多个常用方法的用法?
- 叮叮当当 警告:"warning: unknown warning option '-Wno-maybe-uninitialized'"
- 读取视频文件"Open CV WARNING: Couldn't read movie file bird.avi"时出现问题
- 调用AAssetManager_fromJava时崩溃:"JNI WARNING: instance fieldID 0x571819bc not valid"
- Qt控制台应用程序"WARNING: QApplication was not created in the main() thread"
- "warning C4987: nonstandard extension used: 'throw (...)'"是什么意思?
- GCC NRVO/RVO warning