Skip to content

UE 5.8 Mac build fails with -Werror,-Wunreachable-code in VRM4ULoader #580

Description

@MarksonChen

Describe the bug

Building VRM4U on Mac with UE 5.8 fails in VRM4ULoader because Clang treats unreachable-code warnings as errors.

The build command was:

"$UE_ROOT/Engine/Build/BatchFiles/Mac/Build.sh" \
  "${PROJECT_NAME}Editor" \
  Mac \
  Development \
  -Project="$PROJECT" \
  -WaitMutex \
  -NoHotReloadFromIDE \
  -Verbose

Errors are:

VrmConvertModel.cpp:2292:8: error: code will never be executed [-Werror,-Wunreachable-code]
VrmConvertModel.cpp:2159:7: error: code will never be executed [-Werror,-Wunreachable-code]

VrmConvertPose.cpp:1092:31: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]

VrmConvertModel_Description.cpp:2269:8: error: code will never be executed [-Werror,-Wunreachable-code]
VrmConvertModel_Description.cpp:2136:7: error: code will never be executed [-Werror,-Wunreachable-code]

The workaround is simple. Adding Clang diagnostic suppression for these warnings in those files allows the plugin to build:

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunreachable-code"
#pragma clang diagnostic ignored "-Wunreachable-code-loop-increment"
#endif

UnrealEngine Version:

  • Unreal Engine: 5.8
  • Platform: macOS
  • Architecture: arm64
  • Compiler: Apple Clang 21.x / Xcode
  • Project type: C++/project build
  • Plugin: VRM4U latest UE5.8-compatible release (20260622)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions