From 70188bb3b23477cdb594c4b635d1bb98fa426626 Mon Sep 17 00:00:00 2001 From: John VanEnk Date: Thu, 23 Jan 2020 22:38:55 -0800 Subject: [PATCH] Enable most warnings, and make them errors. This adds `-Wall` and `-Werror` to the C and C++ compiler flags. It also adds `-Wno-attributes` to disable warnings about unrecognized attributes. This is needed because the `swift_name` test relies on `__attribute__((swift_name(some_name)))` attribute. --- tests/tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 8c0b2ba..ae4ce78 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -72,6 +72,10 @@ fn compile(cbindgen_output: &Path, language: Language) { command.arg("-D").arg("DEFINED"); command.arg("-c").arg(cbindgen_output); command.arg("-o").arg(&object); + command.arg("-Wall"); + command.arg("-Werror"); + // `swift_name` is not recognzied by gcc. + command.arg("-Wno-attributes"); if let Language::Cxx = language { // enum class is a c++11 extension which makes g++ on macos 10.14 error out // inline variables are are a c++17 extension