12.07.2015 Views

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

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

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

编 译 器 特 有 的 功 能4.3.1 __attribute__((alias))可 以 使 用 此 函 数 属 性 为 函 数 指 定 多 个 别 名 。如 果 函 数 是 在 当 前 转 换 单 元 中 定 义 的 , 则 会 将 别 名 调 用 替 换 为 函 数 调 用 , 并 将别 名 与 原 始 名 称 一 起 发 出 。 如 果 函 数 不 是 在 当 前 转 换 单 元 中 定 义 的 , 则 会 将 别名 调 用 替 换 为 对 真 实 函 数 的 调 用 。 如 果 将 某 个 函 数 定 义 为 static, 则 会 将 函 数名 称 替 换 为 别 名 ; 如 果 将 别 名 声 明 为 外 部 别 名 , 则 会 将 该 函 数 声 明 为 外 部 函数 。注 意此 函 数 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。注 意也 可 以 使 用 相 应 变 量 属 性 __attribute__((alias)) 为 变 量 名 称 指 定 别 名 。语 法return-type newname([argument-list]) __attribute__((alias("oldname")));其 中 :oldname 是 要 指 定 别 名 的 函 数 的 名 称newname 是 已 指 定 别 名 的 函 数 的 新 名 称 。示 例#include void foo(void){printf("%s\n", __FUNCTION__);}void bar(void) __attribute__((alias("foo")));void gazonk(void){bar(); // calls foo}另 请 参 阅• 第 4-47 页 的 __attribute__((alias))4-32 Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348BCNon-Confidential, Unrestricted AccessID090708

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

Saved successfully!

Ooh no, something went wrong!