Variable '~' set but not used errors, while building source code in Xcode

I’m having the same problem. I am using XCode 13.3 on an M1 Mac running Monterey 12.3.
After following this thread, I figured out that we must add the following to the compiler.

-Wno-unused-but-set-variable

To do that, open

/UnrealEngine/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/MacToolChain.cs

and in the GetCompileArguments_Global function, add in the following line after the Result variable has been declared.

Result += " -Wno-unused-but-set-variable";

After that, XCode will no longer complain about the variables not being set, however I am now stuck with the following:

/UnrealEngine/Engine/Plugins/Media/ElectraPlayer/Source/ElectraPlayerRuntime/Private/Runtime/3rdParty/FastDelegate/FastDelegate.h:602:30:
Ordered comparison of function pointers (‘Electra::fastdelegate::DelegateMemento::GenericFuncPtr’ (aka ‘void (*)()’) and ‘Electra::fastdelegate::DelegateMemento::GenericFuncPtr’)

Hopefully someone else with more knowledge about function pointers than me can help out.

3 Likes