Silence CLibSecp256k1 shorten-64-to-32 warnings via wrapper (#1927)

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
jackandjack authored and GitHub committed 2026-11-27 15:39:12 -10:00
1 parent 6a34773ca8
commit 29d20cadd0
2 files changed
+20 -1

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ let package = Package(
"COPYING"
],
sources: [
"src/secp256k1.c",
"secp256k1_wrapper.c",
"src/precomputed_ecmult.c",
"src/precomputed_ecmult_gen.c"
],
@@ -0,0 +1,19 @@
/*
* Local wrapper around upstream libsecp256k1's single-translation-unit entry point.
*
* Xcode's project-level GCC_WARN_64_TO_32_BIT_CONVERSION (-Wshorten-64-to-32)
* propagates to local Swift packages, triggering benign narrowing warnings in
* upstream libsecp256k1 (which intentionally truncates verified values and
* builds without -Wshorten-64-to-32). Suppressing the diagnostic here keeps
* upstream sources verbatim and avoids SwiftPM .unsafeFlags in Package.swift.
*/
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#endif
#include "src/secp256k1.c"
#if defined(__clang__)
#pragma clang diagnostic pop
#endif