12.07.2015 Views

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

编 译 器 特 有 的 功 能4.3.14 __attribute__((unused))unused 函 数 属 性 禁 止 编 译 器 在 未 引 用 该 函 数 时 生 成 警 告 。 这 不 会 更 改 删 除 未 使用 函 数 的 过 程 的 行 为 。注 意此 函 数 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。示 例static int Function_Attributes_unused_0(int b) __attribute__ ((unused));4.3.15 __attribute__((used))此 函 数 属 性 指 示 编 译 器 在 对 象 文 件 中 保 留 静 态 函 数 , 即 使 将 该 函 数 解 除 引 用 也是 如 此 。标 记 为 已 使 用 的 静 态 函 数 将 按 照 其 声 明 顺 序 发 出 到 单 个 节 。 可 以 使 用__attribute__((section)) 指 定 将 函 数 放 置 到 的 节 。注 意此 函 数 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。注 意也 可 以 使 用 __attribute__((used)) 将 静 态 变 量 标 记 为 已 使 用 。示 例static int lose_this(int);static int keep_this(int) __attribute__((used)); // retained in object filestatic int keep_this_too(int) __attribute__((used)); // retained in object file另 请 参 阅• 第 4-38 页 的 __attribute__((section("name")))• 第 4-52 页 的 __attribute__((used))<strong>ARM</strong> DUI 0348BC Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. 4-39ID090708Non-Confidential, Unrestricted Access

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!