corrode
corrode copied to clipboard
C to Rust translator
happy and alex worked fine but the corrode install fails. The Glorious Glasgow Haskell Compilation System, version 8.0.2 ``` >cabal install Resolving dependencies... Configuring corrode-0.1.0.0... Building corrode-0.1.0.0... Failed to install...
I was trying to convert [ashuffle](https://github.com/joshkunz/ashuffle) and got as far as https://github.com/joshkunz/ashuffle/blob/master/src/args.c#L20 before ``` stack exec -- corrode -c args.c -std=c99 -Wall -Wextra -pedantic -I/usr/local/Cellar/libmpdclient/2.10/include >/dev/null ("args.c": line 20): Corrode...
After translating [api.c](http://github.com/ddugovic/antichess-tree-server/blob/corrode/api.c) and renaming to `src/main.rs`, then with `cargo run` I observe: ``` Compiling antichess-tree-server v0.1.0 (file:///home/dand/Desktop/antichess-tree-server) error[E0381]: use of possibly uninitialized variable: `tree` --> src/main.rs:80:18 | 80 |...
It would be awesome to see some examples of corrode produced rust in the repo, or be able to easily generate some to example what kinds of C it's able...
Fixes #158
The following code: ```C typedef enum { false, true } boolean; boolean mayFail() { return false; } void avoidErasure() { } void checksForFail() { if (mayFail()) { avoidErasure(); } }...
It seems like arrays are decayed into mere pointers. This causes all sorts of problems. Let's start a very simple test example (one that does not require stdio): `int main()...
When compiling C source that uses `exit`, I get a type error because exit is declared to return void (`fn exit(__status : i32);`) rather than diverging (`fn exit(__status : i32)...