From e4cef96be6f03aa3e7e4979f1d55f8e66289904b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 1 Nov 2012 12:55:21 -0400 Subject: [PATCH] cmd/gc: avoid %#x of 0 Plan 9 and Go's lib9/fmt disagree on whether %#x includes the 0x prefix when printing 0, because ANSI C gave bad advice long ago. Avoiding that case makes binaries compiled on different systems compatible. R=ken2 CC=akumar, golang-dev https://golang.org/cl/6814066 --- src/cmd/gc/esc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/gc/esc.c b/src/cmd/gc/esc.c index a2bcbae8fe..6ac0ea530f 100644 --- a/src/cmd/gc/esc.c +++ b/src/cmd/gc/esc.c @@ -233,7 +233,7 @@ mktag(int mask) if(mask < nelem(tags) && tags[mask] != nil) return tags[mask]; - snprint(buf, sizeof buf, "esc:%#x", mask); + snprint(buf, sizeof buf, "esc:0x%x", mask); s = strlit(buf); if(mask < nelem(tags)) tags[mask] = s; -- 2.50.0