public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Fix handling of getaddrinfo return type
@ 2018-02-01 15:50 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2018-02-01 15:50 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

This libgo patch declares the return type of the C getaddrinfo
function, when called from Go, as int32 rather than int.  That is
important because getaddrinfo returns negative numbers on error, and
so numbers like -2 in int32 were being treated as 0xfffffffe in int,
which in Go is a 64 bit type.  This caused comparisons against
EAI_NONAME, etc., to fail.  This fixes https://golang.org/issue/23645.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 930 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 257280)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-71758f9ca1804743afe178f0e2fca489e0217474
+b833695618d1a5d9d531f5ba0f9c07c7e35e0073
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/net/cgo_unix.go
===================================================================
--- libgo/go/net/cgo_unix.go	(revision 257217)
+++ libgo/go/net/cgo_unix.go	(working copy)
@@ -23,7 +23,7 @@ import (
 )
 
 //extern getaddrinfo
-func libc_getaddrinfo(node *byte, service *byte, hints *syscall.Addrinfo, res **syscall.Addrinfo) int
+func libc_getaddrinfo(node *byte, service *byte, hints *syscall.Addrinfo, res **syscall.Addrinfo) int32
 
 //extern freeaddrinfo
 func libc_freeaddrinfo(res *syscall.Addrinfo)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-01 15:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 15:50 libgo patch committed: Fix handling of getaddrinfo return type Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).