Hi, I have implemented a slightly large nested struct which holds a primary dataset that I use to modify my actors with that I want to display. When trying to convert from UE5.1 to UE5.3 I get a conversion error:
/Users/…/BlueprintInterfaceLibrary.gen.cpp:1712:288: error: implicit conversion from ‘unsigned long’ to ‘uint16’ (aka ‘unsigned short’) changes value from 83088 to 17552 [-Werror,-Wconstant-conversion]
const UECodeGen_Private::FStructPropertyParams Z_Construct_UScriptStruct_FACabStruct_Statics::NewProp_cab_6 = { “cab_6”, nullptr, (EPropertyFlags)0x0010000000000005, UECodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, nullptr, nullptr, 1, STRUCT_OFFSET(FACabStruct, cab_6), Z_Construct_UScriptStruct_FACabStruct, METADATA_PARAMS(UE_ARRAY_COUNT(Z_Construct_UScriptStruct_FACabStruct_Statics::NewProp_cab_6_MetaData), Z_Construct_UScriptStruct_FACabStruct_Statics::NewProp_cab_6_MetaData) }; // 2978280576
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/Epic Games/UE_5.3/Engine/Source/Runtime/Core/Public/Templates/UnrealTemplate.h:201:40: note: expanded from macro ‘STRUCT_OFFSET’
#define STRUCT_OFFSET( struc, member ) __builtin_offsetof(struc, member)
This worked in 5.1 and at the same time, the UnrealTemplate engine code seems to be untouched for quite some time. So I don’t think this is a new error introduced, but something that bubbled up.
At the same time this falls back to the __clang implementation of __buildin_offsetof(struc,member), which might be part of the issue.
This happens both when trying to convert the project (as in loading the UE5.1 project from UE5.3) and when generating a new UE5.3 project, copying the code in, and modifying it to the extent that all other compiler errors are gone.
The reason why it is a static nested struct is that I used to read this from a json file where FJsonObjectConverter::JsonObjectToUStruct requires such struct.
Any recommendations?