-
-
Notifications
You must be signed in to change notification settings - Fork 1
incorrect-looking // +build lines #1
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I've been analyzing // +build usage in the Go ecosystem and turned up internal/cpu/init.go, which says:
// +build 386 !gccgo,amd64 !gccgo,amd64p32 !gccgo
It looks like the intent here was "(386 && !gccgo) || (amd64 && !gccgo) || (amd64p32 && !gccgo)",
but the meaning is "386 || (!gccgo && amd64) || (!gccgo && amd64p32) || !gccgo",
or equivalently "386 || !gccgo".
There are two ways to write the presumed intent. As one line:
// +build 386,!gccgo amd64,!gccgo amd64p32,!gccgo
or as two lines:
// +build 386 amd64 amd64p32
// +build !gccgo
Best,
Russ
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working