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.

编 译 器 特 有 的 功 能使 用 具 有 透 明 联 合 类 型 的 参 数 定 义 函 数 时 , 如 果 函 数 调 用 使 用 的 自 变 量 具 有 联合 中 的 任 何 类 型 , 则 会 导 致 初 始 化 具 有 以 下 成 员 的 联 合 对 象 : 成 员 具 有 传 递 的自 变 量 类 型 , 并 将 其 值 设 置 为 传 递 的 自 变 量 值 。使 用 __attribute__((transparent_union)) 限 定 联 合 数 据 类 型 时 , 透 明 联 合 将 应 用于 所 有 具 有 该 类 型 的 函 数 参 数 。注 意此 类 型 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。注 意也 可 以 使 用 相 应 __attribute__((transparent_union)) 变 量 属 性 限 定 各 个 函 数 参数 。示 例typedef union { int i; float f; } U __attribute__((transparent_union));void foo(U u){static int s;s += u.i; /* Use the 'int' field */}void caller(void){foo(1); /* u.i is set to 1 */foo(1.0f); /* u.f is set to 1.0f */}模 式仅 在 GNU 模 式 下 支 持 。另 请 参 阅• 第 4-51 页 的 __attribute__((transparent_union))<strong>ARM</strong> DUI 0348BC Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. 4-45ID090708Non-Confidential, Unrestricted Access

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

Saved successfully!

Ooh no, something went wrong!