mirror of
https://github.com/golang/go
synced 2024-11-18 21:34:46 -07:00
go.tools/pointer: suppress warnings from unsafe.Pointer conversions in the "syscall" package.
This is a short-term usability measure. Longer term, we need to audit each conversion to decide whether it should be ignored or modelled by an analytic summary. R=crawshaw CC=golang-dev https://golang.org/cl/13263050
This commit is contained in:
parent
d38c09ed22
commit
7a5597c226
@ -450,9 +450,14 @@ func (a *analysis) genConv(conv *ssa.Convert) {
|
||||
case *types.Pointer:
|
||||
// unsafe.Pointer -> *T? (currently unsound)
|
||||
if utSrc == tUnsafePtr {
|
||||
// For now, suppress unsafe.Pointer conversion
|
||||
// warnings on "syscall" package.
|
||||
// TODO(adonovan): audit for soundness.
|
||||
if conv.Parent().Pkg.Object.Path() != "syscall" {
|
||||
a.warnf(conv.Pos(),
|
||||
"unsound: %s contains an unsafe.Pointer conversion (to %s)",
|
||||
conv.Parent(), tDst)
|
||||
}
|
||||
|
||||
// For now, we treat unsafe.Pointer->*T
|
||||
// conversion like new(T) and create an
|
||||
|
Loading…
Reference in New Issue
Block a user