-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/api: does not handle shift by a types constant. #2907
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
Labels
Milestone
Comments
I think I might've fixed this in the process of fixing 2906 Owner changed to @bradfitz. Status changed to Started. |
Actually, why does this matter? goapi isn't supposed to be a completely generic tool (at least not yet). It's only supposed to analyze the Go 1 codebase. If it runs against the Go 1 codebase with correct results, that's good enough for now. Once the AST has type information, then this tool gets less hacky. Status changed to WaitingForReply. |
It was a sub-isssue of 2906, I actually only found this on unexported constants so it's a non-problem. I still have problems when running the tool on gccgo codebase (is it a target for Go1?): on os package: unknown kind in const "WNOHANG" (*ast.SelectorExpr): unknown constant reference to syscall.WNOHANG on syscall package: unknown type of variable "SizeofCmsghdr", type *ast.CallExpr, error = unresolved named "int" code: int(unsafe.Sizeof(Cmsghdr{})) (here gccgo has var SizeofCmsgHdr instead of const SizeofMsgHdr, I guess that goes under issue #1790). |
syscall.WNOHANG is defined in the generated file sysinfo.go. Does goapi see that file when you run it? (I have not tried running goapi on the gccgo library.) We could rewrite SizeofCmsgHdr and friends to be var SizeofCmsgHdr int = unsafe.Sizeof(Cmsghdr{}) but it would be even nicer if we could figure out a way to make them const as they are for 6g. I suppose we could change -fdump-go-spec to dump the size of every struct. |
The original issue is supposed to have been fixed by http://golang.org/cl/5644050, I believe. |
Opened https://golang.org/issue/3156 Closing this one. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: