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

panic: unknown node type: 'BuiltinAttr 0x1d448112da0 <<invalid sloc>> Implicit 836' #893

Open
rhomari opened this issue Aug 13, 2022 · 3 comments

Comments

@rhomari
Copy link

rhomari commented Aug 13, 2022

panic: unknown node type: 'BuiltinAttr 0x1d448112da0 <> Implicit 836'

goroutine 52 [running]:
github.com/elliotchance/c2go/ast.Parse({0xc000303d90, 0x37})
C:/Users/tariq/go/src/github.com/elliotchance/c2go/ast/ast.go:294 +0x2205
main.convertLinesToNodes({0xc000169420, 0x18d, 0x66?})
C:/Users/tariq/go/src/github.com/elliotchance/c2go/main.go:89 +0x115
main.convertLinesToNodesParallel.func1.2({0xc000169420?, 0x0?, 0x0?}, 0x0?)
C:/Users/tariq/go/src/github.com/elliotchance/c2go/main.go:121 +0x39
created by main.convertLinesToNodesParallel.func1
C:/Users/tariq/go/src/github.com/elliotchance/c2go/main.go:119 +0x2b3

I had this error message, please check on it.

@elliotchance
Copy link
Owner

Since the parser works on understanding the non-machine output of the clang AST changes and edge cases constantly need to be added. Here is an example of adding a new node: #832

@nagylzs
Copy link

nagylzs commented Oct 30, 2022

 c2go transpile test.c                                                                                                                                               2 ↵
panic: unknown node type: 'BuiltinAttr 0x2101168 <<invalid sloc>> Inherited Implicit 837'

goroutine 62 [running]:
github.com/elliotchance/c2go/ast.Parse({0xc00016edb1, 0x3d})
	/home/gandalf/projects/c2go/ast/ast.go:294 +0x2205
main.convertLinesToNodes({0xc000178800, 0x3b, 0x0?})
	/home/gandalf/projects/c2go/main.go:89 +0x115
main.convertLinesToNodesParallel.func1.2({0xc000178800?, 0x0?, 0x0?}, 0x0?)
	/home/gandalf/projects/c2go/main.go:121 +0x39
created by main.convertLinesToNodesParallel.func1
	/home/gandalf/projects/c2go/main.go:119 +0x2b3

Is it the same problem, or is it a different problem? I'm trying to transpile the example C program (testing prime numbers) with go1.19.2 and this clang:

Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix

@ilius
Copy link

ilius commented Nov 23, 2022

Can you give me a hint how to modify my C code to make it compile to Go?
Here is my panic line (I modified the message a bit):

panic: unknown node type, fullline="BuiltinAttr 0x2179f58 <<invalid sloc>> Inherited Implicit 799", nodeName="BuiltinAttr"

goroutine 9 [running]:
github.com/elliotchance/c2go/ast.Parse({0xc0001d2f11, 0x3d})
	.../github.com/elliotchance/c2go/ast/ast.go:295 +0x2228
main.convertLinesToNodes({0xc0002df680, 0x369, 0x0?})
	.../github.com/elliotchance/c2go/main.go:89 +0x115
main.convertLinesToNodesParallel.func1.2({0xc0002df680?, 0x0?, 0x0?}, 0x0?)
	.../github.com/elliotchance/c2go/main.go:121 +0x39
created by main.convertLinesToNodesParallel.func1
	.../github.com/elliotchance/c2go/main.go:119 +0x2b3

My C code: https://github.com/ilius/ls-go/blob/sort-version/c/filevercmp.c

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

4 participants