While the SECP_TRY_APPEND_DEFAULT_CFLAGS macro works with the current compiler flag set, it is not perfect.
For example, it will accept -fvisibility-inlines-hidden flag, which actually causes:
cc1: warning: command-line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for CThis PR improves robustness of the SECP_TRY_APPEND_DEFAULT_CFLAGS macro.
FWIW, the same approach is used in our CMake-based build system, and in Bitcoin Core.
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
This is a backport of secp256k1#1241