We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ubuntu2310 + llvm-config-15 + C2Rust 0.18.0
input:
#include <stdio.h> static void Encode(char *str_) { const char *volatile str = str_; static const char *HEX = "0123456789ABCDEF"; while (*str) { int c = (unsigned char)*str++; } } int main() { Encode(NULL); return 0; }
output:
#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] unsafe extern "C" fn Encode(mut str_: *mut libc::c_char) { let mut str: *const libc::c_char = str_; static mut HEX: *const libc::c_char = b"0123456789ABCDEF\0" as *const u8 as *const libc::c_char; while *str != 0 { let fresh0 = ::core::ptr::read_volatile::< *const libc::c_char, >(&str as *const *const libc::c_char); ::core::ptr::write_volatile( &mut str as *mut *const libc::c_char, (::core::ptr::read_volatile::< *const libc::c_char, >(&str as *const *const libc::c_char)) .offset(1), ) let mut c: libc::c_int = *fresh0 as libc::c_uchar as libc::c_int; } } unsafe fn main_0() -> libc::c_int { Encode(0 as *mut libc::c_char); return 0 as libc::c_int; } pub fn main() { unsafe { ::std::process::exit(main_0() as i32) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ubuntu2310 + llvm-config-15 + C2Rust 0.18.0
input:
output:
The text was updated successfully, but these errors were encountered: