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.

编 译 器 特 有 的 功 能} S;#pragma pack(2)typedef struct{char a;int b;} SP;S var = { 0x11, 0x44444444 };SP pvar = { 0x11, 0x44444444 };图 4-1 是 S 的 布 局 ; 图 4-2 是 SP 的 布 局 。 在 图 4-2 中 , x 表 示 单 字 节 填 充 。注 意SP 是 一 个 6 字 节 结 构 。 b 之 后 没 有 填 充 。0 1 2 3a padding4 5 6 7b b b b图 4-1 非 压 缩 结 构 S0 1 2 3a x b b4b5b图 4-2 压 缩 结 构 SP另 请 参 阅• 第 4-11 页 的 __packed• 第 4-50 页 的 __attribute__((packed))• 第 5-10 页 的 压 缩 结 构• 《 编 译 器 用 户 指 南 》 中 第 5-25 页 的 __packed 限 定 符 和 未 对 齐 的 数 据 访 问• 《 编 译 器 用 户 指 南 》 中 第 5-27 页 的 __packed 结 构 与 单 个 __packed 字 段 。4-66 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!