1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00

cmd/internal/gc: fix vet detected printf problems

Fixes #10805.

Change-Id: Ia77639e606a0c18fc53cba9749d92f325014025f
Reviewed-on: https://go-review.googlesource.com/10040
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Shenghou Ma 2015-05-13 19:05:50 -04:00 committed by Minux Ma
parent dbf533a546
commit b3fb0fdd3f
6 changed files with 772 additions and 770 deletions

View File

@ -183,7 +183,7 @@ func declare(n *Node, ctxt uint8) {
}
if ctxt == PEXTERN && s.Name == "init" {
Yyerror("cannot declare init - must be func", s)
Yyerror("cannot declare init - must be func")
}
gen := 0

View File

@ -965,7 +965,7 @@ func cgen_callmeth(n *Node, proc int) {
l := n.Left
if l.Op != ODOTMETH {
Fatal("cgen_callmeth: not dotmethod: %v")
Fatal("cgen_callmeth: not dotmethod: %v", l)
}
n2 := *n

View File

@ -21,6 +21,7 @@
package gc
import (
"fmt"
"strings"
)
%}
@ -1975,9 +1976,9 @@ hidden_import:
importlist = list(importlist, $2);
if Debug['E'] > 0 {
print("import [%q] func %lN \n", importpkg.Path, $2);
fmt.Printf("import [%q] func %v \n", importpkg.Path, $2)
if Debug['m'] > 2 && $2.Func.Inl != nil {
print("inl body:%+H\n", $2.Func.Inl);
fmt.Printf("inl body:%v\n", $2.Func.Inl)
}
}
}

View File

@ -1303,7 +1303,7 @@ OpSwitch:
if l.Op == OTYPE {
if n.Isddd || l.Type.Bound == -100 {
if l.Type.Broke == 0 {
Yyerror("invalid use of ... in type conversion", l)
Yyerror("invalid use of ... in type conversion to %v", l.Type)
}
n.Diag = 1
}
@ -1528,7 +1528,7 @@ OpSwitch:
var t *Type
switch l.Type.Etype {
default:
Yyerror("invalid operation: %v (arguments have type %v, expected floating-point)", n, l.Type, r.Type)
Yyerror("invalid operation: %v (arguments have type %v, expected floating-point)", n, l.Type)
n.Type = nil
return
@ -1645,7 +1645,7 @@ OpSwitch:
n.Type = t
if !Isslice(t) {
if Isconst(args.N, CTNIL) {
Yyerror("first argument to append must be typed slice; have untyped nil", t)
Yyerror("first argument to append must be typed slice; have untyped nil")
n.Type = nil
return
}
@ -3526,7 +3526,7 @@ func typecheckfunc(n *Node) {
func stringtoarraylit(np **Node) {
n := *np
if n.Left.Op != OLITERAL || n.Left.Val.Ctype != CTSTR {
Fatal("stringtoarraylit %N", n)
Fatal("stringtoarraylit %v", n)
}
s := n.Left.Val.U.Sval

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff