You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
func f(fn func() error) error {
return fn()
}
func main() {
called := false
f(func() error {
called = true
return nil
})
}
gc considers called to be both set and used although nowhere in the scope is the value of called ever consulted.
gccgo-5.0 on the other hand considers this code to be faulty
% env LD_LIBRARY_PATH=/opt/gccgo/lib64 PATH=$PATH:/opt/gccgo/bin go build -compiler=gccgo /tmp/x.go
# command-line-arguments
/tmp/x.go:8:2: error: ‘called’ declared and not used
called := false
^
For this function
gc considers
called
to be both set and used although nowhere in the scope is the value ofcalled
ever consulted.gccgo-5.0 on the other hand considers this code to be faulty
gccgo version
The text was updated successfully, but these errors were encountered: