Konstantin8105 / c4go

Transpiling C code to Go code
MIT License
363 stars 37 forks source link

strange usage of switch won't be able to be transpiled to Go #484

Open QianNangong opened 4 years ago

QianNangong commented 4 years ago

for example:

int i;
int x = /** some code */;
switch (x) {
case 0: for (i = 0; i < 3; i++) {
case 1: /** some code */;
case 2: /** some code */;
case 3: /** some code */; }
}
Konstantin8105 commented 4 years ago

Hello, Now, we can transpile C code only if we can compile C code. Your code looks not good. But, in that code strange for in switch. How you expect Go code?

QianNangong commented 4 years ago

But it does compile using gcc or clang.

发自我的iPhone

------------------ Original ------------------ From: Konstantin <notifications@github.com> Date: Mon,Jun 15,2020 10:32 PM To: Konstantin8105/c4go <c4go@noreply.github.com> Cc: Frozen-Tofu <me@kaze.ai>, Author <author@noreply.github.com> Subject: Re: [Konstantin8105/c4go] strange usage of switch won't be able to be transpiled to Go (#484)

Hello, Now, we can transpile C code only if we can compile C code. Your code looks not good. But, in that code strange for in switch. How you expect Go code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Konstantin8105 commented 4 years ago

Ok, @Frozen-Tofu Fell free for create PR and implement the solution.

jtarchie commented 4 years ago

What the heck C?