[fpc-devel] Bug or Feature? Inline of code from Units does not work when types uses in code are defined in implementation

Florian Klämpfl florian at freepascal.org
Mon Apr 6 22:19:20 CEST 2015

Am 06.04.2015 um 19:23 schrieb Michael Ring:
> Thanks,
> So do you think it is worth to extend documentation for inline? Or perhaps the compiler could give a
> warning when code is not suitable for inlining or is this decision done when a caller requests
> inlining and not when the inline function gets compiled?

If the situation is clear, the compiler gives a hint. In this case, the procedure is inlined if it
is called in the same unit, otherwise not.

The decision, if a procedure can be inlined is pretty difficult and changes also from time to time,
so I prefer neither to document (situation might change and documentation gets wrong) it nor
increase the hints regarding this (sometimes it is really hard to explain why something is not inlined).

More information about the fpc-devel mailing list