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.

编 译 器 特 有 的 功 能限 制在 调 用 noreturn 函 数 时 , 不 会 保 留 返 回 地 址 。 这 会 限 制 调 试 器 显 示 调 用 堆 栈 的功 能 。示 例__declspec(noreturn) void overflow(void); // never return on overflowint negate(int x){if (x == 0x80000000) overflow();return -x;}另 请 参 阅• 第 4-36 页 的 __attribute__((noreturn))4.2.5 __declspec(nothrow)__declspec(nothrow) 属 性 指 明 函 数 调 用 从 不 导 致 将 C++ 异 常 从 调 用 传 播 到 调 用方 。<strong>ARM</strong> 库 头 自 动 将 此 限 定 符 添 加 到 C 函 数 声 明 中 , 依 照 ISO C 标 准 , 这 些 函 数 从不 抛 出 异 常 。用 法如 果 编 译 器 知 道 函 数 从 不 抛 出 异 常 , 它 或 许 可 以 为 该 函 数 的 调 用 方 生 成 较 小 的异 常 处 理 表 。限 制如 果 函 数 调 用 导 致 将 C++ 异 常 从 调 用 传 播 到 调 用 方 , 则 该 行 为 是 未 定 义 的 。如 果 在 不 启 用 异 常 的 情 况 下 进 行 编 译 , 则 会 忽 略 此 修 饰 符 。示 例struct S{~S();};__declspec(nothrow) extern void f(void);void g(void)4-28 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!