<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/cmd/cgo, branch dev.inline</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>cmd/cgo: fix cgo checking when fetching errno value</title>
<updated>2016-12-01T02:13:50+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-30T23:46:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=d4b704e110dea8395d107f5fd3be9f3cf2e8d161'/>
<id>d4b704e110dea8395d107f5fd3be9f3cf2e8d161</id>
<content type='text'>
Fixes #18126.

Change-Id: I7ae090945ef203673b06eb94817cc5c894b5eadc
Reviewed-on: https://go-review.googlesource.com/33752
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #18126.

Change-Id: I7ae090945ef203673b06eb94817cc5c894b5eadc
Reviewed-on: https://go-review.googlesource.com/33752
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: ignore top-level qualifiers in function args/results</title>
<updated>2016-11-17T19:03:55+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-16T17:55:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=7061dc3f6e94dbc369db779ec6799c6f60d3466f'/>
<id>7061dc3f6e94dbc369db779ec6799c6f60d3466f</id>
<content type='text'>
The top-level qualifiers are unimportant for our purposes. If a C
function is defined as `const int f(const int i)`, the `const`s are
meaningless to C, and we want to avoid using them in the struct we
create where the `const` has a completely different meaning.

This unwinds https://golang.org/cl/33097 with regard to top-level
qualifiers.

Change-Id: I3d66b0eb43b6d9a586d9cdedfae5a2306b46d96c
Reviewed-on: https://go-review.googlesource.com/33325
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The top-level qualifiers are unimportant for our purposes. If a C
function is defined as `const int f(const int i)`, the `const`s are
meaningless to C, and we want to avoid using them in the struct we
create where the `const` has a completely different meaning.

This unwinds https://golang.org/cl/33097 with regard to top-level
qualifiers.

Change-Id: I3d66b0eb43b6d9a586d9cdedfae5a2306b46d96c
Reviewed-on: https://go-review.googlesource.com/33325
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: add missing period in comment</title>
<updated>2016-11-15T17:42:30+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-14T23:51:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=59dc9d7a89829127883dd5e2d8b042f1e5b40336'/>
<id>59dc9d7a89829127883dd5e2d8b042f1e5b40336</id>
<content type='text'>
Change-Id: I05f31938f3736100bd8b20a150c9fe3a6ffcdeae
Reviewed-on: https://go-review.googlesource.com/33245
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I05f31938f3736100bd8b20a150c9fe3a6ffcdeae
Reviewed-on: https://go-review.googlesource.com/33245
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: run cgo pointer checks for pointer to union</title>
<updated>2016-11-15T17:10:52+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-14T23:51:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=27b68474ca8bffea06a4dd11424b293243ae846c'/>
<id>27b68474ca8bffea06a4dd11424b293243ae846c</id>
<content type='text'>
If a C union type (or a C++ class type) can contain a pointer field,
then run the cgo checks on pointers to that type. This will test the
pointer as though it were an unsafe.Pointer, and will crash if it points
to Go memory that contains a pointer.

Fixes #15942.

Change-Id: Ic2d07ed9648d4b27078ae7683e26196bcbc59fc9
Reviewed-on: https://go-review.googlesource.com/33237
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a C union type (or a C++ class type) can contain a pointer field,
then run the cgo checks on pointers to that type. This will test the
pointer as though it were an unsafe.Pointer, and will crash if it points
to Go memory that contains a pointer.

Fixes #15942.

Change-Id: Ic2d07ed9648d4b27078ae7683e26196bcbc59fc9
Reviewed-on: https://go-review.googlesource.com/33237
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: don't ignore qualifiers, don't cast to void*</title>
<updated>2016-11-11T01:31:12+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-10T22:34:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=fb8c896aff9549e868df58f9d40fd06b67ae7d07'/>
<id>fb8c896aff9549e868df58f9d40fd06b67ae7d07</id>
<content type='text'>
The cgo tool used to simply ignore C type qualifiers. To avoid problems
when a C function expected a qualifier that was not present, cgo emitted
a cast to void* around all pointer arguments. Unfortunately, that broke
code that contains both a function declaration and a macro, when the
macro required the argument to have the right type. To fix this problem,
don't ignore qualifiers. They are easy enough to handle for the limited
set of cases that matter for cgo, in which we don't care about array or
function types.

Fixes #17537.

Change-Id: Ie2988d21db6ee016a3e99b07f53cfb0f1243a020
Reviewed-on: https://go-review.googlesource.com/33097
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The cgo tool used to simply ignore C type qualifiers. To avoid problems
when a C function expected a qualifier that was not present, cgo emitted
a cast to void* around all pointer arguments. Unfortunately, that broke
code that contains both a function declaration and a macro, when the
macro required the argument to have the right type. To fix this problem,
don't ignore qualifiers. They are easy enough to handle for the limited
set of cases that matter for cgo, in which we don't care about array or
function types.

Fixes #17537.

Change-Id: Ie2988d21db6ee016a3e99b07f53cfb0f1243a020
Reviewed-on: https://go-review.googlesource.com/33097
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: delete unused variable in log statement</title>
<updated>2016-11-09T15:31:55+00:00</updated>
<author>
<name>Josh Bleecher Snyder</name>
<email>josharian@gmail.com</email>
</author>
<published>2016-11-06T19:58:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=ad020477f4dfe731450b6dd3dd15ea43aab0d0f1'/>
<id>ad020477f4dfe731450b6dd3dd15ea43aab0d0f1</id>
<content type='text'>
visit is just a func, and there's no formatting
verb for it, and it's on an internal-error path.
It has been thus many years, unchanged and unexecuted.

Change-Id: I4c2e2673ee9996218c24143bcc3be3eb4abdff25
Reviewed-on: https://go-review.googlesource.com/32970
Run-TryBot: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
visit is just a func, and there's no formatting
verb for it, and it's on an internal-error path.
It has been thus many years, unchanged and unexecuted.

Change-Id: I4c2e2673ee9996218c24143bcc3be3eb4abdff25
Reviewed-on: https://go-review.googlesource.com/32970
Run-TryBot: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: add support for GOARCH=mips{,le}</title>
<updated>2016-11-03T22:56:37+00:00</updated>
<author>
<name>Vladimir Stefanovic</name>
<email>vladimir.stefanovic@imgtec.com</email>
</author>
<published>2016-10-18T21:50:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=3f2b85a8d14cb0435a84501ac9f25d80d6129348'/>
<id>3f2b85a8d14cb0435a84501ac9f25d80d6129348</id>
<content type='text'>
Change-Id: I47c6867fc653c8388ad32e210a8027baa592eda3
Reviewed-on: https://go-review.googlesource.com/31483
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I47c6867fc653c8388ad32e210a8027baa592eda3
Reviewed-on: https://go-review.googlesource.com/31483
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: add #line directives to avoid printing bogus references to Go source files</title>
<updated>2016-11-03T16:35:25+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2016-11-02T23:41:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b2290229c23fed8e4a63241568e436b1daa1196f'/>
<id>b2290229c23fed8e4a63241568e436b1daa1196f</id>
<content type='text'>
A bit contrived to come up with an example, but it happened in #15836, somehow.

	$ cat /tmp/x.go
	package main

	/*
	#include &lt;stddef.h&gt;

	int foo(void);

	int foo(void) {
		return 2;
	}

	#define int asdf
	*/
	import "C"

	func main() {
		println(C.foo())
	}

	$ go run /tmp/x.go
	# command-line-arguments
	cgo-builtin-prolog:9:31: error: unknown type name 'asdf'   &lt;&lt;&lt;&lt;&lt;
	_GoString_ GoStringN(char *p, int l);
	                              ^
	/tmp/x.go:12:13: note: expanded from macro 'int'
	#define int asdf
	            ^
	cgo-builtin-prolog:10:28: error: unknown type name 'asdf'  &lt;&lt;&lt;&lt;&lt;
	_GoBytes_ GoBytes(void *p, int n);
	                           ^
	/tmp/x.go:12:13: note: expanded from macro 'int'
	#define int asdf
	            ^
	2 errors generated.

The two marked lines used to refer incorrectly to /tmp/x.go.

Fixes #15836.

Change-Id: I08ef60a53cfd148112fceb651eaf7b75d94a7a8d
Reviewed-on: https://go-review.googlesource.com/32613
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A bit contrived to come up with an example, but it happened in #15836, somehow.

	$ cat /tmp/x.go
	package main

	/*
	#include &lt;stddef.h&gt;

	int foo(void);

	int foo(void) {
		return 2;
	}

	#define int asdf
	*/
	import "C"

	func main() {
		println(C.foo())
	}

	$ go run /tmp/x.go
	# command-line-arguments
	cgo-builtin-prolog:9:31: error: unknown type name 'asdf'   &lt;&lt;&lt;&lt;&lt;
	_GoString_ GoStringN(char *p, int l);
	                              ^
	/tmp/x.go:12:13: note: expanded from macro 'int'
	#define int asdf
	            ^
	cgo-builtin-prolog:10:28: error: unknown type name 'asdf'  &lt;&lt;&lt;&lt;&lt;
	_GoBytes_ GoBytes(void *p, int n);
	                           ^
	/tmp/x.go:12:13: note: expanded from macro 'int'
	#define int asdf
	            ^
	2 errors generated.

The two marked lines used to refer incorrectly to /tmp/x.go.

Fixes #15836.

Change-Id: I08ef60a53cfd148112fceb651eaf7b75d94a7a8d
Reviewed-on: https://go-review.googlesource.com/32613
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: only record typedef name for pointer to struct</title>
<updated>2016-11-01T23:06:24+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-11-01T21:13:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=689947d5652e51980fbfc7b350871fe2baa06a74'/>
<id>689947d5652e51980fbfc7b350871fe2baa06a74</id>
<content type='text'>
In a function argument, we handle a typedef for a pointer specially,
using the pointer type rather than the typedef, to permit the Go calls
to match the laxer type conversions permitted in C. We record the
typedef so that we use that type in the C code, in case it has a special
attribute. However, using the typedef is wrong when using a pointer to a
basic type, because the C code may sometimes use the typedef and
sometimes not, and using the typedef in all cases will cause incorrect
type errors on the Go side. Fortunately we only really need to use the
typedef when pointing to a struct/union/class, and in such a case
confusion is unlikely.

Fixes #17723.

Change-Id: Id2eaeb156faeaf2e8eb9cf0b8f95b44caf8cfbd2
Reviewed-on: https://go-review.googlesource.com/32536
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: David Crawshaw &lt;crawshaw@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a function argument, we handle a typedef for a pointer specially,
using the pointer type rather than the typedef, to permit the Go calls
to match the laxer type conversions permitted in C. We record the
typedef so that we use that type in the C code, in case it has a special
attribute. However, using the typedef is wrong when using a pointer to a
basic type, because the C code may sometimes use the typedef and
sometimes not, and using the typedef in all cases will cause incorrect
type errors on the Go side. Fortunately we only really need to use the
typedef when pointing to a struct/union/class, and in such a case
confusion is unlikely.

Fixes #17723.

Change-Id: Id2eaeb156faeaf2e8eb9cf0b8f95b44caf8cfbd2
Reviewed-on: https://go-review.googlesource.com/32536
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: David Crawshaw &lt;crawshaw@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/cgo: add -srcdir option</title>
<updated>2016-10-30T19:14:08+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-10-30T16:30:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f135106ec7cf68b47a5b83a1c2b5dd7eda0d614c'/>
<id>f135106ec7cf68b47a5b83a1c2b5dd7eda0d614c</id>
<content type='text'>
This is convenient for direct use of `go tool cgo`. We can also use it
from the go tool to reduce the length of the file names that cgo
generates.

Update #17070.

Change-Id: I8466a0a2cc68a732d17d07319e303497715bac8c
Reviewed-on: https://go-review.googlesource.com/32354
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is convenient for direct use of `go tool cgo`. We can also use it
from the go tool to reduce the length of the file names that cgo
generates.

Update #17070.

Change-Id: I8466a0a2cc68a732d17d07319e303497715bac8c
Reviewed-on: https://go-review.googlesource.com/32354
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
