elva

__attribute__((deprecated))

RealView 编译工具 编译器参考指南

4.5.4. __attribute__((deprecated))

可以使用 deprecated 变量属性声明不提倡使用的变量,而不会导致编译器发出任何警告或错误。但是,对 deprecated 变量的任何访问都会生成警告,但仍会进行编译。警告指出了使用和定义变量的位置。这有助于确定不提倡使用特定定义的原因。

Note

此变量属性是 ARM 编译器支持的 GNU 编译器扩展。

示例

extern int Variable_Attributes_deprecated_0 __attribute__ ((deprecated));
extern int Variable_Attributes_deprecated_1 __attribute__ ((deprecated));
void Variable_Attributes_deprecated_2()
{
    Variable_Attributes_deprecated_0=1;
    Variable_Attributes_deprecated_1=2;
}

编译此示例时,将生成两条警告消息。

Copyright © 2007-2009 ARM Limited. All rights reserved. ARM DUI 0348BC
Non-Confidential



转载自:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348bc/Caccahah.html

posted on 2011-12-28 20:26 叶子 阅读(1936) 评论(0)  编辑 收藏 引用 所属分类: C\C++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理