adding FORCEINLINE to the methods in TAutoConsoleVariable in Engine\Source\Runtime\Core\Public\HAL\IConsoleManager.h

Hey Epic Friends!

under the right conditions, I’ve been able to end up with linker errors because the compiler doesn’t inline the templated methods in TAutoConsoleVariable for <float> or <bool>. That yields multiple multiple modules with those compiled in and a sad linker. I’ve worked around this by adding FORCEINLINE into the header (which is weird, because the C++ spec says those should be best effort inlined because their definition is in the class file, but not dice). Is that something you would be willing to do on your end?

Thanks!

Josh

Hi Joshua,

Can you confirm which compiler you are seeing this on? Do you happen to have a project that repro’s this?

Best regards

Thanks Joshua. I’ll run this by the development team. To confirm, you are referring the the GetValueOn* methods?

Best regards.

Thanks Joshua, and do you recall which platform was being targeted by the server build?

Thanks Joshua,

Are you building against the recommended toolchains? https://dev.epicgames.com/documentation/en\-us/unreal\-engine/linux\-development\-requirements\-for\-unreal\-engine

Best regards.

Thanks for the details. Please reach out if the issue pops back.

Best regards.

Hi Joshua,

As far as I can see on build machines on this end, it appears to be building as authored against the recommended toolchains. However, please do circle back if the issue occurs on your end under those conditions.

Best regards.

Thanks Joshua, much appreciated!

sorry, it’s an issue I fixed long ago that I’m now posting about because i’m upgrading the engine and going over my changes. I believe it was clang, as I remember it only showing up when building the server on horde.

yes those and the constructor and destructor even.

thanks!

Josh

linux

we just merged 5.6 and this build is using 18.1.0 but back when I noticed the problem we were on 5.5 so we might have been on clang 16.0.6 still

will do- just to be clear are you saying I should be able to remove the FORCEINLINE and not hit this anymore? Or are you saying you’re going to add it in?

ok thanks, I’ll take them out and let you know if it comes up again / I get an exact repro. I do believe it was the editing of some .cpp file (and therefore removal of that file from the unity build file) that made the compiler act weird.