c-for-go icon indicating copy to clipboard operation
c-for-go copied to clipboard

processing wpilib.yml ⠙panic: Enum

Open qhdwight opened this issue 5 years ago • 0 comments

I've seen https://github.com/xlab/c-for-go/issues/66 but it looks like updating the packages does not work for me. The changes here do not seem to be in model.go, which is strange.

I am on macOS Catalina using Go version 1.13.3 with Go modules. Side-note, I had to use the define __has_include_next in my .yml since for some reason newer Mac file layouts do not populate usr/include anymore.

Here is the full code.

Here is my .yml:

---
GENERATOR:
  PackageName: wpi
  PackageDescription: "Go bindings for WPILib"
  PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."
  Includes: ["hal/HAL.h"]
  FlagGroups:
    - {name: LDFLAGS, flags: [-Llib,-lwpiHal,-lwpilibc,-lwpiutil,-lstdc++]}

PARSER:
  IncludePaths: ["include/"]
  SourcesPaths: ["hal/HAL.h"]
  Defines:
    __has_include_next(x): 1

Here is my go.mod:

module go-frc

go 1.13

require (
	github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 // indirect
	github.com/tj/go-spin v1.1.0 // indirect
	github.com/xlab/c-for-go v0.0.0-20190821155445-8eeee8c3b71f // indirect
	github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 // indirect
	golang.org/x/tools v0.0.0-20191023202404-2b779830f9d3 // indirect
	gopkg.in/yaml.v2 v2.2.4 // indirect
	modernc.org/cc v1.0.0 // indirect
	modernc.org/golex v1.0.0 // indirect
	modernc.org/mathutil v1.0.0 // indirect
	modernc.org/strutil v1.1.0 // indirect
	modernc.org/xc v1.0.0 // indirect
)

Here is the result of the command:

$ c-for-go -ccincl wpilib.yml
  processing wpilib.yml ⠙panic: Enum

goroutine 1 [running]:
modernc.org/cc.(*Model).typ(0x17b5240, 0x18, 0x9, 0xc000315058)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/model.go:204 +0x383
modernc.org/cc.(*Model).BinOpType(0x17b5240, 0x151b3a0, 0xc0006242a0, 0x151b3a0, 0xc00060b5e0, 0xc00060b5e0, 0xc000010330)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/model.go:1541 +0x389
modernc.org/cc.(*Model).binOp(0x17b5240, 0xc0002fe400, 0x150e0e0, 0xc0006a4900, 0x150e0e0, 0xc0006a49c0, 0xc000624000, 0xc000315160, 0x1172718, 0xc0006240e0, ...)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/model.go:1451 +0x2b7
modernc.org/cc.(*Expression).eval(0xc0006a4a80, 0xc0002fe400, 0x0, 0xc0002cda78, 0xc0003158b8, 0x116fbad)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/ast2.go:2402 +0xb207
modernc.org/cc.(*Expression).cond(0xc0006a4e40, 0xc0002fe400, 0x150e120, 0xc0007f94a0)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/ast2.go:749 +0x60
modernc.org/cc.(*Expression).eval(0xc0006a4e40, 0xc0002fe400, 0xc000315fe0, 0x100c228, 0x8, 0x13fa040)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/ast2.go:2541 +0x12c3
modernc.org/cc.(*ExpressionList).eval(0xc0007f94f0, 0xc0002fe400, 0x4d, 0xc0001cc538, 0x151b300, 0xc0006aa1c0)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/ast2.go:2716 +0x75
modernc.org/cc.yyParse(0x150e160, 0xc0002fe400, 0x0)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/parser.go:3301 +0x3cd5
modernc.org/cc.Parse(0xc0002fa380, 0x330, 0xc00004eb90, 0x1, 0x1, 0x17b5240, 0xc00009dc50, 0xa, 0xa, 0x0, ...)
	/Users/quintin/go/pkg/mod/modernc.org/[email protected]/cc.go:830 +0x5e7
github.com/xlab/c-for-go/parser.ParseWith(0xc0001e8280, 0xc00004e9a0, 0x1, 0x1)
	/Users/quintin/go/pkg/mod/github.com/xlab/[email protected]/parser/parser.go:101 +0x108d
main.NewProcess(0x7ffeefbffb0f, 0xa, 0x0, 0x0, 0xc000018c20, 0xc000244db0, 0x0)
	/Users/quintin/go/pkg/mod/github.com/xlab/[email protected]/process.go:80 +0x2b4
main.main()
	/Users/quintin/go/pkg/mod/github.com/xlab/[email protected]/main.go:79 +0x1bf

qhdwight avatar Oct 23 '19 21:10 qhdwight