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
cgo enum value handling varies depending on whether enum type is referenced #479
Labels
Comments
It would actually appear that when it's not referenced, there's no way to get dwarf symbols for it. The compiled program that ends up being output for the first one is: typedef struct { char *p; int n; } _GoString_; _GoString_ GoString(char *p); char *CString(_GoString_); typedef enum {a, b, c, d} foo; void f(void) { #line 0 "cgo-test" c; d; a; b; } As you can see here, the enum is never referenced, and thus no dwarf stabs are generated for it. As soon as we reference C.foo: typedef struct { char *p; int n; } _GoString_; _GoString_ GoString(char *p); char *CString(_GoString_); typedef enum {a, b, c, d} foo; void f(void) { #line 0 "cgo-test" c; d; foo; a; b; } This yields dwarf stabs. Unfortunately, I'm not entirely sure how to deal with this. This pretty much means that any unnamed enumeration (e.g. enum { ... } as opposed to typedef enum { ... } bla) is unusable, essentially requiring godefs. I'll play around a bit, but I'm not sure I'm coming up with any solutions tonight. |
This issue was closed by revision 690fcac. Status changed to Fixed. Merged into issue #-. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by emage@spamcop.net:
The text was updated successfully, but these errors were encountered: