c4go icon indicating copy to clipboard operation
c4go copied to clipboard

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

Open QianNangong opened this issue 4 years ago • 4 comments

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 */; }
}

QianNangong avatar Jun 15 '20 02:06 QianNangong

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?

Konstantin8105 avatar Jun 15 '20 14:06 Konstantin8105

But it does compile using gcc or clang.

发自我的iPhone

------------------ Original ------------------ From: Konstantin <[email protected]> Date: Mon,Jun 15,2020 10:32 PM To: Konstantin8105/c4go <[email protected]> Cc: Frozen-Tofu <[email protected]>, Author <[email protected]> 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.

QianNangong avatar Jun 16 '20 03:06 QianNangong

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

Konstantin8105 avatar Jun 16 '20 07:06 Konstantin8105

What the heck C?

jtarchie avatar Aug 05 '20 02:08 jtarchie