Skip to content
New issue

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

Bug: Seems to do nothing #825

Open
pjebs opened this issue May 16, 2019 · 1 comment
Open

Bug: Seems to do nothing #825

pjebs opened this issue May 16, 2019 · 1 comment

Comments

@pjebs
Copy link

pjebs commented May 16, 2019

I tried to convert tray.h from https://github.com/zserge/tray

It produced practically nothing.

I then removed the linux and windows code from tray.h

Then it paniced:

panic: unknown node type: '...'

goroutine 51 [running]:
github.com/elliotchance/c2go/ast.Parse(0xc00027e401, 0x3, 0x12944d8, 0x5)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/ast/ast.go:270 +0x4314
main.convertLinesToNodes(0xc000254000, 0x628, 0x18a3, 0x31313a656e696c3c, 0x6c6f63202c313a30, 0x6c6f63203e39333a)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:89 +0x1cf
main.convertLinesToNodesParallel.func1.1(0xc000064060, 0xc00000c008, 0xc000254000, 0x628, 0x18a3, 0x0)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:113 +0x59
created by main.convertLinesToNodesParallel.func1
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:111 +0x112
Prasangas-MacBook-Pro:tray-master pj$ c2go transpile tray_darwin.h
panic: unknown node type: '...'

goroutine 20 [running]:
github.com/elliotchance/c2go/ast.Parse(0xc000402401, 0x3, 0x12944d8, 0x5)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/ast/ast.go:270 +0x4314
main.convertLinesToNodes(0xc00034c000, 0x628, 0x18a3, 0x0, 0x0, 0x0)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:89 +0x1cf
main.convertLinesToNodesParallel.func1.1(0xc00025e000, 0xc00024e000, 0xc00034c000, 0x628, 0x18a3, 0x0)
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:113 +0x59
created by main.convertLinesToNodesParallel.func1
	/Users/pj/GOPATH/src/github.com/elliotchance/c2go/main.go:111 +0x112
@elliotchance
Copy link
Owner

Unfortunately one of those files contains a language feature that c2go cannot understand. Although, the error message is not very helpful.

c2go will invoke clang to do the compilation. So the actual source that gets parsed (also by clang) will be based on the environment that it would otherwise compile under. Perhaps some of the pragmas are different and some source code is being excluded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants