jethrogb / rust-cexpr

A C expression parser and evaluator
Apache License 2.0
45 stars 19 forks source link

Please yank 0.2.1 #6

Closed jethrogb closed 7 years ago

jethrogb commented 7 years ago

cexpr 0.2.1 introduced a regression in bindgen 0.19.1

Input header file:

#define MBEDTLS_ECP_MAX_BITS 521
#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 )
#define MBEDTLS_ECDSA_MAX_LEN ( 3 + 2 * ( 3 + MBEDTLS_ECP_MAX_BYTES ) )

Output with bindgen 0.19.1 and cexpr 0.2.0:

/* automatically generated by rust-bindgen */

#![allow(dead_code,
         non_camel_case_types,
         non_upper_case_globals,
         non_snake_case)]
pub const MBEDTLS_ECP_MAX_BITS: ::std::os::raw::c_ushort = 521;
pub const MBEDTLS_ECP_MAX_BYTES: ::std::os::raw::c_uchar = 66;
pub const MBEDTLS_ECDSA_MAX_LEN: ::std::os::raw::c_uchar = 141;

Output with bindgen 0.19.1 and cexpr 0.2.1:

/* automatically generated by rust-bindgen */

#![allow(dead_code,
         non_camel_case_types,
         non_upper_case_globals,
         non_snake_case)]
pub const MBEDTLS_ECP_MAX_BITS: ::std::os::raw::c_ushort = 521;
pub const MBEDTLS_ECP_MAX_BYTES: ::std::os::raw::c_uchar = 66;

(You can get the old versions of bindgen using cargo clone)

jethrogb commented 7 years ago

Done, and bug fixed in 75265c358e29a39e4cfec528e669a9d0a8e7ff4a / 0.2.2