We are trying to upgrade our project from 5.3 to 5.5, in the process we are getting couple of errors saying “Error C4702 : unreachable code”. I understand reason of this error but we would like to avoid this error to sustain implemented logic. Would you please let us know if there is a way to suppress this error in UE5.5 source.
You can set the TargetRules.AdditionalCompilerArguments member in XXX.Target.cs. This also requires the usage of a unique build environment which will result in using custom Editor\Engine build artefacts.
`///EXAMPLE
public class Custom55EditorTarget : TargetRules
{
public Custom55EditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V5;
ExtraModuleNames.AddRange( new string { “Custom55” } );
If you want to keep using a shared build environnement (default), you can customize the code for UnrealBuildTool. Look for AppendCLArguments_Global in VCToolchain.cs and add the argument to the Arguments list.