[fpc-devel] "inline" issue
J. Gareth Moreton
gareth at moreton-family.com
Mon Apr 22 18:46:35 CEST 2019
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
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel