}
if int64(pc) > p.Pc {
- ctxt.Diag("PC padding invalid: want %#d, has %#d: %v", p.Pc, pc, p)
+ ctxt.Diag("PC padding invalid: want %d, has %d: %v", p.Pc, pc, p)
}
for int64(pc) != p.Pc {
// emit 0xe1a00000 (MOVW R0, R0)
// remove the NOTUSETMP flag in optab.
op := c.opirr(p, p.As)
if op&Sbit != 0 {
- c.ctxt.Diag("can not break addition/subtraction when S bit is set", p)
+ c.ctxt.Diag("can not break addition/subtraction when S bit is set (%v)", p)
}
rt, r := p.To.Reg, p.Reg
if r == obj.REG_NONE {
Fingerprint goobj.FingerprintType // fingerprint of symbol indices, to catch index mismatch
}
+// Assert to vet's printf checker that Link.DiagFunc is a printf-like.
+func _(ctxt *Link) {
+ ctxt.DiagFunc = func(format string, args ...any) {
+ _ = fmt.Sprintf(format, args...)
+ }
+}
+
func (ctxt *Link) Diag(format string, args ...interface{}) {
ctxt.Errors++
ctxt.DiagFunc(format, args...)
switch o.type_ {
default:
- c.ctxt.Diag("unknown type %d %v", o.type_)
+ c.ctxt.Diag("unknown type %d", o.type_)
prasm(p)
case 0: // pseudo ops
}
}
- c.ctxt.Diag("bad class combination: %s %s,%s\n", a, fclass, tclass)
+ c.ctxt.Diag("bad class combination: %s %d,%s\n", a, fclass, tclass)
return 0
}
}
switch o.type_ {
default:
- c.ctxt.Diag("unknown type %d %v", o.type_)
+ c.ctxt.Diag("unknown type %d", o.type_)
prasm(p)
case 0: /* pseudo ops */
switch p.To.Sym.Name {
case "go_args_stackmap":
if p.From.Type != TYPE_CONST || p.From.Offset != abi.FUNCDATA_ArgsPointerMaps {
- ctxt.Diag("%s: FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps", p.Pos)
+ ctxt.Diag("%v: FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps", p)
}
p.To.Sym = ctxt.LookupDerived(curtext, curtext.Name+".args_stackmap")
case "no_pointers_stackmap":
if p.From.Type != TYPE_CONST || p.From.Offset != abi.FUNCDATA_LocalsPointerMaps {
- ctxt.Diag("%s: FUNCDATA use of no_pointers_stackmap(SB) without FUNCDATA_LocalsPointerMaps", p.Pos)
+ ctxt.Diag("%v: FUNCDATA use of no_pointers_stackmap(SB) without FUNCDATA_LocalsPointerMaps", p)
}
// funcdata for functions with no local variables in frame.
// Define two zero-length bitmaps, because the same index is used
low, high, err := Split32BitImmediate(ins.imm)
if err != nil {
- p.Ctxt.Diag("%v: constant %d too large", p, ins.imm, err)
+ p.Ctxt.Diag("%v: constant %d too large: %v", p, ins.imm, err)
return nil
}
if high == 0 {