c2v
c2v copied to clipboard
C/C++ to V translator
There were 3 files I translated, all exhibits similar characteristics: all translated successfully but lots of errors when running the file. Starting from sorting_algorithms (bubble sort, heap sort, etc) Then...
fiix the bug of #172 [Can't translate compound struct and union; (https://github.com/vlang/c2v/issues/172) ## testcase 1 - case struct ss{ union{int i;int j;}; int i1; }; - result struct Ss {...
when I tranlate this file by ·`zig cc assert.c && ./a.out ` ``` //assert.c #include int main(){ assert(0); } ``` error happend : ``` assert.v:5:81: error: use `?` instead of...
On my Mac OS X 13.6, I have c language code which already compiled with compiler, like the piece: ``` // filename : main.c typedef enum {asymbol,anumber}atom_type; typedef struct sexpr_...
When trying to convert to V using `./c2v` on [Neved4/swc.c#L98](https://github.com/Neved4/twc/blob/main/twc.c#L98) #### Lines ```c strftime(timestr, sizeof(timestr), s, localtime(&t)); ``` #### Output ```log v wcs.v wcs.v:16:14: error: parameter name must not begin...
``` Remotery.v:729:14: error: parameter name must not begin with upper case letter (`Wchar_t`) 727 | rem i64 728 | } 729 | fn mbstowcs( Wchar_t *restrict, Char *restrict, usize) usize...
``` Remotery.v:729:22: error: use `&Type` instead of `*Type` when declaring references 727 | rem i64 728 | } 729 | fn mbstowcs( wchar_t *restrict, char *restrict, usize) usize ``` I...
Call `clang -xc++ -E -v` to get system headers instead of hardcoded array It avoids some problems on windows.
In several places, the wrapper generator created `void *` casts, and put in "Unknown union at messages into the code, uncommented. Below is the translated wrapper, and the header files...
### Describe the bug I attempted to make a wrapper for the Playdate SDK, but v translate detected no files when passing in a directory, and translated nothing. ### Reproduction...