]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: fix printf format in typecheck.c
authorRob Pike <r@golang.org>
Wed, 19 Feb 2014 20:50:50 +0000 (15:50 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 19 Feb 2014 20:50:50 +0000 (15:50 -0500)
There are probably more of these, but bound and len are 64 bits so use %lld
in message about array index out of bounds.
Fixes the 386 build.

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews, rickarnoldjr
https://golang.org/cl/66110043

src/cmd/gc/typecheck.c

index 6b5ad8188699641fc80031318be334fcc8c309dd..ac2e8a45595d6c3f118cf3094e854d7ba2ecc602 100644 (file)
@@ -2503,7 +2503,7 @@ typecheckcomplit(Node **np)
                                len = i;
                                if(t->bound >= 0 && len > t->bound) {
                                        setlineno(l);
-                                       yyerror("array index %d out of bounds [0:%d]", len-1, t->bound);
+                                       yyerror("array index %lld out of bounds [0:%lld]", len-1, t->bound);
                                        t->bound = -1;  // no more errors
                                }
                        }