Skip to content

Unsigned global set to -1 #1040

Closed
Closed
@e00E

Description

Input C/C++ Header

unsigned long long g_107 = 18446744073709551615UL;

Bindgen Invocation

bindgen failing.h -o failing.rs

Actual Results

Bindgen generates

pub const g_107: ::std::os::raw::c_ulonglong = -1;

which when compiled with rustc --crate-type lib --test -o out failing2.rs gives

error[E0600]: cannot apply unary operator `-` to type `u64`
 --> failing2.rs:3:48
  |
3 | pub const g_107: ::std::os::raw::c_ulonglong = -1;
  |                                                ^^

error: aborting due to previous error

Expected Results

Not sure, but 18446744073709551615 does not look like -1 in the first place.
Found with csmith fuzzing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions