Skip to content

Commit

Permalink
[dev.cc] liblink: fix warnings on Plan 9
Browse files Browse the repository at this point in the history
warning: src/liblink/list6.c:94 set and not used: s
warning: src/liblink/list6.c:157 format mismatch ld VLONG, arg 3
warning: src/liblink/list6.c:157 format mismatch E UINT, arg 4
warning: src/liblink/list6.c:157 format mismatch d VLONG, arg 5
warning: src/liblink/list6.c:163 set and not used: s
warning: src/liblink/list9.c:105 set and not used: s
warning: src/liblink/list9.c:185 format mismatch ld VLONG, arg 3
warning: src/liblink/list9.c:185 format mismatch E UINT, arg 4
warning: src/liblink/list9.c:185 format mismatch d VLONG, arg 5
warning: src/liblink/list9.c:193 set and not used: s

LGTM=rsc
R=rsc
CC=austin, golang-codereviews, minux
https://golang.org/cl/176130043
  • Loading branch information
0intro committed Nov 21, 2014
1 parent 213a664 commit 2f28916
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ extern LinkArch linkpower64;
extern LinkArch linkpower64le;

#pragma varargck type "A" int
#pragma varargck type "E" uint
#pragma varargck type "D" Addr*
#pragma varargck type "lD" Addr*
#pragma varargck type "P" Prog*
Expand Down
6 changes: 3 additions & 3 deletions src/liblink/list6.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Pconv(Fmt *fp)
if(p->reg)
s += sprint(s, " reg=%d", p->reg);
if(p->to.type != D_NONE)
s += sprint(s, " to={%#D}", &p->to);
sprint(s, " to={%#D}", &p->to);
return fmtstrcpy(fp, str);
}

Expand Down Expand Up @@ -154,13 +154,13 @@ Dconv(Fmt *fp)
s += sprint(s, "%s ", dnames6[i]);
else
s += sprint(s, "%d ", i);
s += sprint(s, "offset=%ld etype=%E width=%d", a->offset, a->etype, a->width);
s += sprint(s, "offset=%lld etype=%E width=%lld", a->offset, a->etype, a->width);
if(a->class != 0)
s += sprint(s, " class=%s", cnames9[(int)a->class]);
if(a->sym != nil)
s += sprint(s, " sym=%s", a->sym->name);
if(a->type == D_BRANCH && a->u.branch != nil)
s += sprint(s, " branch=%.5lld", a->u.branch->pc);
sprint(s, " branch=%.5lld", a->u.branch->pc);
goto brk;
}

Expand Down
6 changes: 3 additions & 3 deletions src/liblink/list9.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Pconv(Fmt *fp)
if(p->from3.type != D_NONE)
s += sprint(s, " from3={%#D}", &p->from3);
if(p->to.type != D_NONE)
s += sprint(s, " to={%#D}", &p->to);
sprint(s, " to={%#D}", &p->to);
return fmtstrcpy(fp, str);
}

Expand Down Expand Up @@ -182,15 +182,15 @@ Dconv(Fmt *fp)
s += sprint(s, "name=%s ", dnames9[(int)a->name]);
else
s += sprint(s, "name=%d ", a->name);
s += sprint(s, "offset=%ld etype=%E width=%d", a->offset, a->etype, a->width);
s += sprint(s, "offset=%lld etype=%E width=%lld", a->offset, a->etype, a->width);
if(a->class != 0)
s += sprint(s, " class=%s", cnames9[(int)a->class]);
if(a->reg != NREG)
s += sprint(s, " reg=%d", a->reg);
if(a->sym != nil)
s += sprint(s, " sym=%s", a->sym->name);
if(a->type == D_BRANCH && a->u.branch != nil)
s += sprint(s, " branch=%.5lld", a->u.branch->pc);
sprint(s, " branch=%.5lld", a->u.branch->pc);
goto ret;
}

Expand Down

0 comments on commit 2f28916

Please sign in to comment.