aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-12-06 20:58:26 +0100
committerFilippo Valsorda <filippo@golang.org>2019-02-27 20:59:09 +0000
commit8390781ca35ac5874eb5b136cfc29bb47adee94b (patch)
tree1f6920a1835f04b26c645954d4860c9bc00e7425
parentaa95a1eb5a3423d96873946d47c663bdc8f3565e (diff)
downloadgo-8390781ca35ac5874eb5b136cfc29bb47adee94b.tar.gz
go-8390781ca35ac5874eb5b136cfc29bb47adee94b.zip
[release-branch.go1.11] crypto/x509: explicitly cast printf format argument
After CL 128056 the build fails on darwin/386 with src/crypto/x509/root_cgo_darwin.go:218:55: warning: values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead [-Wformat] go build crypto/x509: C compiler warning promoted to error on Go builders Fix the warning by explicitly casting the argument to an int as suggested by the warning. Fixes #30444 Change-Id: Icb6bd622a543e9bc5f669fd3d7abd418b4a8e579 Reviewed-on: https://go-review.googlesource.com/c/152958 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit ec0077c54d6261ba5cbab2c5dc2e80345068233f) Reviewed-on: https://go-review.googlesource.com/c/164240 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/crypto/x509/root_cgo_darwin.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go
index a168135a33..e6332072d6 100644
--- a/src/crypto/x509/root_cgo_darwin.go
+++ b/src/crypto/x509/root_cgo_darwin.go
@@ -215,7 +215,7 @@ int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots, bool debugD
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1;
char *buffer = malloc(maxSize);
if (CFStringGetCString(summary, buffer, maxSize, kCFStringEncodingUTF8)) {
- printf("crypto/x509: %s returned %d\n", buffer, result);
+ printf("crypto/x509: %s returned %d\n", buffer, (int)result);
}
free(buffer);
CFRelease(summary);