Mac compiling errors - object backing the pointer ... will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment]

I am getting many of that errors when compiling a project with Betide’s EOS Integration Kit on macOS. Source of this issue seem to be this deprecated macro:

"TCHAR_TO_UTF8(Ptr) is deprecated, please use StringCast<UTF8CHAR>(PtrToTChar) instead.")*/ (ANSICHAR*)FTCHARToUTF8((const TCHAR*)str).Get()

Apparently one of the latest Xcode updates applied some tweaks on the compiler as well. In Rider I see the same deprecation messages on Windows OS, but there they don’t cause any errors.

Is there a way to exclude -Wdangling from the compiler checks?

yes, please reference here

Added the flag Arguments.Add(“-Wno-error”) to the GetCompileArguments_Global function on the MacToolChain.cs, but it does not fix the issue.

Finally I fixed this by adding additional compiler flags to the target.cs files of the project.