[fpc-devel] "inline" issue

J. Gareth Moreton gareth at moreton-family.com
Tue Apr 23 16:31:30 CEST 2019

I should ask actually... what's Delphi's support on 'inline' appearing 
just in the implementation section?

Given how many units have "inline" in just the implementation section, 
and how some cross-platform units have "inline" on platforms that 
benefit from it on their particular implementation, I wonder if there's 
a better solution to the CRC problem than just demanding it appear in 
the interface section, such as having "inline" modify the body's CRC 
rather than the header's CRC (if my knowledge of CRCs are correct).

Gareth aka. Kit

On 22/04/2019 17:46, J. Gareth Moreton wrote:
> Hi everyone,
> Jonas and I were talking today through e-mail and he mentioned on 
> #35346 the following interesting point:
> "An inline directive in the implementation but not in the interface 
> should be rejected by the compiler, because it changes the interface 
> crc. I know it does not do that currently, but that is a compiler bug."
> With Jonas' blessing, I've taken it upon myself to experiment with 
> changing the compiler so it catches the above situation, but then 
> "make all" fails to build because a large number of functions in the 
> System unit have "inline" in the implementation section but not the 
> interface section.  Some of these are assembler functions and so 
> should not be inlined anyway (the compiler will not inline them 
> regardless), but there are a number of functions like ReadBarrier that 
> are inlined on some platforms but not on others, so putting "inline" 
> in the interface section may not be the best solution in these 
> situations.  More obviously, not allowing "inline" to appear in the 
> implementation section by itself will potentially cause a lot of 
> third-party programs and units to now fail compilation.
> I'm attempting to change the functions in the System unit so the 
> compiler at least builds on i386 and x86_64, but I can see this being 
> a problem.  What's the best way of resolving this?
> Gareth aka. Kit
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

This email has been checked for viruses by Avast antivirus software.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190423/ed2870da/attachment.html>

More information about the fpc-devel mailing list