From 64282a7c68062c690a21ab403cd5a9fe9a7cd532 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Thu, 30 May 2024 16:44:39 -0400 Subject: [PATCH] Build with `-Werror=implicit-function-declaration` To prevent fail-fast in situations like https://github.com/rust-lang/rust/issues/125619, where an upstream source compiles but creates a link error way downstream. --- build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.rs b/build.rs index df98688d..e5503e88 100644 --- a/build.rs +++ b/build.rs @@ -327,6 +327,8 @@ mod c { // in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19. cfg.flag_if_supported("-fomit-frame-pointer"); cfg.define("VISIBILITY_HIDDEN", None); + // Avoid implicitly creating references to undefined functions + cfg.flag("-Werror=implicit-function-declaration"); } // int_util.c tries to include stdlib.h if `_WIN32` is defined,