编译器提示:“内联函数”...“尚未扩展...” [英] Compiler Hint: "Inline function '...' has not been expanded..."

查看:194
本文介绍了编译器提示:“内联函数”...“尚未扩展...”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个单元中,我使用函数 DeleteFile ,编译器输出一个提示:

In a unit I use the function DeleteFile and the compiler outputs a hint:


H2443内联函数DeleteFile尚未扩展,因为在US列表中未指定单位Windows

"H2443 Inline function 'DeleteFile' has not been expanded because unit 'Windows' is not specified in USES list"

使用 SysUtils ,定义 DeleteFile (虽然内部调用 Windows.DeleteFile )。

In Uses there is SysUtils, which defines DeleteFile (although internally calling Windows.DeleteFile).

这个提示是什么意思?如果我将 Windows 加入使用子句,那么它已经不见了,但是我想了解这是什么麻烦了编译器

What does this hint mean? If I put Windows into the Uses clause, it's gone, but I would like to understand what it is that bothers the compiler.

推荐答案

这是一个内联限制。

请参阅Hallvard Vassbotn的关于内联例程的文章。

See Hallvard Vassbotn's article about Inlined Routines.

从该网站提取:


其余的内联限制
对于这两个平台和
最重要的是

The rest of the inlining restrictions are common for both platforms and the most important ones are


  • 没有内联在包边界

  • 内联例程无法访问实施部分标识符

  • 呼叫站点必须可以访问内联
    例程中使用的所有标识符


注意最后一点表示除非呼叫站点单位使用t他所需的单位是例行程序,不能内联。当这种情况发生时,编译器会像这样发出一个提示

Note The last point means that unless the call site unit uses the units required by the routine, the routine cannot be inlined. When this happens, the compiler emits a hint like this

 [Pascal Hint] InlinedRoutinesU.pas(14): H2443 Inline function 
   'InlineMe' has not been expanded because unit 'RequiredUnit' 
    is not specified in USES list 

要解决问题,请将缺少的单元名称添加到调用站点的uses子句中。

To resolve the issue, add the missing unit name to the call site's uses clause.


这篇关于编译器提示:“内联函数”...“尚未扩展...”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆