Skip to content

Commit 6243033

Browse files
committed
define MBEDTLS_CHECK_RETURN_WARNING
Although, bindgen needs .enable_function_attribute_detection() to process __attribute__((__warn_unused_result__)) because parsing attrs can be really slow in certain cases. Benches were performed to confirm our case doesn't face that issue. References: rust-lang/rust-bindgen#2149 rust-lang/rust-bindgen#1465 rust-lang/rust-bindgen#1466 rust-lang/rust-bindgen#1467
1 parent 112a267 commit 6243033

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mbedtls-sys/build/bindgen.rs

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ impl super::BuildConfig {
117117
}
118118

119119
let bindings = bindgen::builder()
120+
.enable_function_attribute_detection()
120121
.clang_args(cc.get_compiler().args().iter().map(|arg| arg.to_str().unwrap()))
121122
.header_contents("bindgen-input.h", &input)
122123
.allowlist_function("^(?i)mbedtls_.*")

mbedtls-sys/build/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const DEFAULT_DEFINES: &'static [CDefine] = &[
146146
("MBEDTLS_AES_ROM_TABLES", Undefined),
147147
("MBEDTLS_AES_FEWER_TABLES", Undefined),
148148
("MBEDTLS_CAMELLIA_SMALL_MEMORY", Undefined),
149-
("MBEDTLS_CHECK_RETURN_WARNING", Undefined),
149+
("MBEDTLS_CHECK_RETURN_WARNING", Defined),
150150
("MBEDTLS_CIPHER_MODE_CBC", Defined),
151151
("MBEDTLS_CIPHER_MODE_CFB", Defined),
152152
("MBEDTLS_CIPHER_MODE_CTR", Defined),

0 commit comments

Comments
 (0)