]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: explicitly cast printf format argument
authorTobias Klauser <tklauser@distanz.ch>
Thu, 6 Dec 2018 19:58:26 +0000 (20:58 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 6 Dec 2018 21:10:35 +0000 (21:10 +0000)
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.

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>
src/crypto/x509/root_cgo_darwin.go

index a168135a334770fba7c6370316308c9c9726fe70..e6332072d62a50d89398bd4d3677fb9f02efc4aa 100644 (file)
@@ -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);