gpt4 book ai didi

delphi - 编译器提示 : "Inline function ' . 。 .' has not been expanded..."

转载 作者:行者123 更新时间:2023-12-03 14:36:10 30 4
gpt4 key购买 nike

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

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

Uses中,有SysUtils,它定义了DeleteFile(尽管内部调用了Windows.DeleteFile)。

这个提示是什么意思?如果我将 Windows 放入 Uses 子句中,它就会消失,但我想了解是什么困扰了编译器。

最佳答案

这是一个内联限制。

请参阅 Hallvard Vassbotn 的有关 Inlined Routines 的文章.

摘自该网站:

The rest of the inlining restrictionsare common for both platforms and themost important ones are

  • no inlining across package boundaries
  • the inlined routine cannot access implementation section identifiers
  • the call site must have access to all identifiers used in the inlinedroutine

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

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

关于delphi - 编译器提示 : "Inline function ' . 。 .' has not been expanded...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/649704/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com