rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

bad type recognition, despite explicit suffix

Open joseluis opened this issue 5 years ago • 2 comments

This code:

#define CELL_WIDEASIAN_MASK     0x8000000000000000ull
#define CELL_NOBACKGROUND_MASK  0x0400000000000000ull

results in:

pub const CELL_WIDEASIAN_MASK: i64 = -9223372036854775808;
pub const CELL_NOBACKGROUND_MASK: u64 = 288230376151711744;

It seems bindgen just notices the leftmost bit on, and decides to turn it into an i64 despite the ull suffix that clearly indicates it should be a u64.

joseluis avatar Aug 17 '20 19:08 joseluis

This is probably an issue in https://github.com/jethrogb/rust-cexpr, which only gives us i64s to begin with.

I wonder if #1782 fixes this.

emilio avatar Aug 18 '20 09:08 emilio

Seems related: #923

burakemir avatar Jul 12 '24 11:07 burakemir