summaryrefslogtreecommitdiff
path: root/doc/go1.html
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-02-19 13:32:55 -0500
committerRuss Cox <rsc@golang.org>2012-02-19 13:32:55 -0500
commit7bec2f4521adc13afc8c915fa6d78e2a8defff2e (patch)
tree518b6cf3a0c3fd1ce75ccda000afc6d8ecd96310 /doc/go1.html
parent228b6d21d8e2102dcd527a00b837743bf49b16da (diff)
downloadgo-7bec2f4521adc13afc8c915fa6d78e2a8defff2e.tar.gz
cmd/cgo: bug fixes
* disallow embedding of C type (Fixes issue 2552) * detect 0-length array (Fixes issue 2806) * use typedefs when possible, to avoid attribute((unavailable)) (Fixes issue 2888) * print Go types constructed from C types using original C types (Fixes issue 2612) This fix changes _cgo_export.h to repeat the preamble from import "C". Otherwise the fix to issue 2612 is impossible, since it cannot refer to types that have not been defined. If people are using //export and putting non-header information in the preamble, they will need to refactor their code. R=golang-dev, r, r CC=golang-dev http://codereview.appspot.com/5672080
Diffstat (limited to 'doc/go1.html')
-rw-r--r--doc/go1.html19
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/go1.html b/doc/go1.html
index 05d3eb503..f4a4623db 100644
--- a/doc/go1.html
+++ b/doc/go1.html
@@ -1853,7 +1853,24 @@ Code that uses the old fields will fail to compile and must be updated by hand.
The semantic changes make it difficult for the fix tool to update automatically.
</p>
-<h2 id="go_command">The go command</h2>
+<h2 id="cmd_go">The go command</h2>
+
+<p>
+TODO: Write this.
+</p>
+
+<h2 id="cmd_cgo">The cgo command</h2>
+
+<p>
+In Go 1, the <a href="/cmd/cgo">cgo command</a>
+uses a different <code>_cgo_export.h</code>
+file, which is generated for packages containing <code>//export</code> lines.
+The <code>_cgo_export.h</code> file now begins with the C preamble comment,
+so that exported function definitions can use types defined there.
+This has the effect of compiling the preamble multiple times, so a
+package using <code>//export</code> must not put function definitions
+or variable initializations in the C preamble.
+</p
<h2 id="releases">Packaged releases</h2>