Build failure on newer macOS SDK versions related to sprintf call in breakpad library
When I try to build VLC, I get the following error:
/Users/kerrick/src/vlc5/contrib/contrib-aarch64-apple-darwin21/breakpad/src/common/dwarf_cfi_to_module.cc:188:3:
error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.
Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.
[-Werror,-Wdeprecated-declarations]
sprintf(buf, "unnamed_register%u", reg);
...
The following build commands failed:
CompileC /Users/kerrick/src/vlc4/contrib/contrib-aarch64-apple-darwin21/breakpad/src/tools/mac/dump_syms/build/dump_syms.build/Release/dump_syms.build/Objects-normal/arm64/dwarf_cfi_to_module.o /Users/kerrick/src/vlc4/contrib/contrib-aarch64-apple-darwin21/breakpad/src/common/dwarf_cfi_to_module.cc normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'dump_syms' from project 'dump_syms')
This issue has been fixed here in the upstream (Google) version of breakpad.
I think this commit is also related, but isn't necessary to make the build work.
I think this project should rebase onto a newer upstream version.
System info:
OS: macOS 12.5
Chip: Apple M2
Xcode version: 14.2, build version 14C18