- 19 Nov, 2019 1 commit
-
-
Than McIntosh authored
Update gccgoPkgpathToSymbolNew() to bring it into conformance with the way that gccgo now handles packagepaths with embedded dots (see CL 200838). See also https://gcc.gnu.org/PR61880, a related bug. Updates #35623. Change-Id: I32f064320b9af387fc17771530c745a9e3003c20 Reviewed-on: https://go-review.googlesource.com/c/go/+/207957 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 02 Oct, 2019 1 commit
-
-
Egon Elbre authored
Currently cgoCheckPointer is only used with one optional argument. Using a slice for the optional arguments is quite expensive, hence replace it with a single interface{}. This results in ~30% improvement. When checking struct fields, they quite often end up being without pointers. Check this before calling cgoCheckPointer, which results in additional ~20% improvement. Inline some p == nil checks from cgoIsGoPointer which gives additional ~15% improvement. All of this translates to: name old time/op new time/op delta CgoCall/add-int-32 46.9ns ± 1% 46.6ns ± 1% -0.75% (p=0.000 n=18+20) CgoCall/one-pointer-32 143ns ± 1% 87ns ± 1% -38.96% (p=0.000 n=20+20) CgoCall/eight-pointers-32 767ns ± 0% 327ns ± 1% -57.30% (p=0.000 n=18+16) CgoCall/eight-pointers-nil-32 110ns ± 1% 89ns ± 2% -19.10% (p=0.000 n=19+19) CgoCall/eight-pointers-array-32 5.09µs ± 1% 3.56µs ± 2% -30.09% (p=0.000 n=19+19) CgoCall/eight-pointers-slice-32 3.92µs ± 0% 2.57µs ± 2% -34.48% (p=0.000 n=20+20) Change-Id: I2aa9f5ae8962a9a41a7fb1db0c300893109d0d75 Reviewed-on: https://go-review.googlesource.com/c/go/+/198081 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 05 Jul, 2019 1 commit
-
-
Austin Clements authored
cgo produces dynamic imports for Go binaries by scanning the dynamic imports table of a binary produced by the system C compiler and linker. Currently, since it uses elf.File.ImportedSymbols, it only reads global symbols. Unfortunately, recent versions of lld emit weak symbol imports for several pthread symbols, which means the cgo tool doesn't emit dynamic imports for them, which ultimately causes linking of cgo binaries to fail. Fix this by using elf.File.DynamicSymbols instead and filtering down to both global and weak symbols. Fixes #31912. Change-Id: If346a7eca6733e3bfa2cccf74a9cda02a3e81d38 Reviewed-on: https://go-review.googlesource.com/c/go/+/184100 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 05 Jun, 2019 1 commit
-
-
Ian Lance Taylor authored
Roll back CL 159258 and CL 168337. Those changes broke existing code. I can't see any way to keep existing code working while also producing good error messages for types like C.ulong (such as the ones already tested for in misc/cgo/errors). This is not an exact roll back because parts of the code have changed since those CLs. Updates #29878 Fixes #31093 Change-Id: I56fe76c167ff0ab381ed273b9ca4b952402e1434 Reviewed-on: https://go-review.googlesource.com/c/go/+/180357 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Dmitri Shuralyov <dmitshur@golang.org>
-
- 27 Mar, 2019 1 commit
-
-
Clément Chigot authored
As .init_array section aren't available on AIX, the Go runtime initialization is made with gcc constructor attribute. However, as cgo tool is building a binary in order to get imported C symbols, Go symbols imported for this initilization must be ignored. -Wl,-berok is mandatory otherwize ld will fail to create this binary, _rt0_aix_ppc64_lib and runtime_rt0_go aren't defined in runtime/cgo. These two symbols must also be ignored when creating _cgo_import.go. Change-Id: Icf2e0282f5b50de5fa82007439a428e6147efef1 Reviewed-on: https://go-review.googlesource.com/c/go/+/169118 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 18 Mar, 2019 1 commit
-
-
Philipp Stephani authored
The exact-width integer types are required to use two’s complement representation and may not have padding bits, cf. §7.20.1.1/1 in the C11 standard or https://en.cppreference.com/w/c/types/integer. This ensures that they have the same domain and representation as the corresponding Go types. Fixes #29878 Change-Id: Ie8a51e91666dfd89731c7859abe47356c94ca1be GitHub-Last-Rev: 546a2cc3f1e22dc282757f73c01c91b00899d911 GitHub-Pull-Request: golang/go#29907 Reviewed-on: https://go-review.googlesource.com/c/go/+/159258 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 08 Mar, 2019 2 commits
-
-
Tobias Klauser authored
The warnings are not strictly tied to FreeBSD but to the clang version. People could still be building with an old version of clang even if not on FreeBSD. The -Wpragmas and -Waddress-of-packed-member warnings were introduced in clang 4.0, so also adjust the comment accordingly. This was discussed as part of CL 160777 which introduced these comments. Updates #27619 Change-Id: I4988ffd08797dcc72cdc264d4abd20a114f70473 Reviewed-on: https://go-review.googlesource.com/c/go/+/165800 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Yuval Pavel Zholkover <paulzhol@gmail.com> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Philipp Stephani authored
Fixes #29879 Change-Id: Id2061a5eab67bb90a8116dc4f16073be1c9a09a9 GitHub-Last-Rev: 186863ab6aa9481744f276a7afbd87bd53c9f863 GitHub-Pull-Request: golang/go#29900 Reviewed-on: https://go-review.googlesource.com/c/go/+/159178 Reviewed-by:
Philipp Stephani <phst@google.com> Reviewed-by:
Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 01 Feb, 2019 1 commit
-
-
Yuval Pavel Zholkover authored
CL 159859 causes build failure with old clang versions (3.4.1) on FreeBSD 10.3/10.4. Update #29962 Update #27619 Change-Id: I78264ac5d8d17eeae89a982e89aac988eb22b286 Reviewed-on: https://go-review.googlesource.com/c/160777 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 30 Jan, 2019 1 commit
-
-
Ian Lance Taylor authored
GCC 9 has started emitting warnings when taking the address of a field in a packed struct may cause a misaligned pointer. We use packed structs in cgo to ensure that our field layout matches the C compiler's layout. Our pointers are always aligned, so disable the warning Fixes #29962 Change-Id: I7e290a7cf694a2c2958529e340ebed9fcd62089c Reviewed-on: https://go-review.googlesource.com/c/159859 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Bryan C. Mills <bcmills@google.com>
-
- 20 Jan, 2019 1 commit
-
-
Ian Lance Taylor authored
Change-Id: I2324f6f51d2bf8a4ae1b139b3933bc78dfa75835 Reviewed-on: https://go-review.googlesource.com/c/158718 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Cherry Zhang <cherryyz@google.com>
-
- 10 Dec, 2018 1 commit
-
-
Clément Chigot authored
This commit moves cmd/internal/xcoff package to internal/xcoff because it will be needed to add XCOFF support in go/internal/gccgoimporter. Change-Id: Id12df0c438fb7db4a6a458fc1478480851bf7771 Reviewed-on: https://go-review.googlesource.com/c/152719 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 02 Dec, 2018 1 commit
-
-
Tobias Klauser authored
Follow-up for CL 147037 and after Brad noticed the "returns whether" pattern during the review of CL 150621. Go documentation style for boolean funcs is to say: // Foo reports whether ... func Foo() bool (rather than "returns whether") Created with: $ perl -i -npe 's/returns whether/reports whether/' $(git grep -l "returns whether" | grep -v vendor) Change-Id: I15fe9ff99180ad97750cd05a10eceafdb12dc0b4 Reviewed-on: https://go-review.googlesource.com/c/150918 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 01 Dec, 2018 1 commit
-
-
Ian Lance Taylor authored
Avoid redefinition errors when a Go file uses a cgo comment to There is no particularly good reason to do this, but there is also no particularly good reason that it should fail. Fixes #27019 Change-Id: Icd6f8197a89be4ee6b03ddae675667998a8b4189 Reviewed-on: https://go-review.googlesource.com/c/152079 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 13 Nov, 2018 1 commit
-
-
Than McIntosh authored
The code to implement new-style gccgo name mangling had a recipe that didn't quite match that of the compiler (incorrect handling for '.'). This showed up as a failure in the gotools cgo test if the directory containing the test run included a "." character. [This is a copy of https://golang.org/cl/147917]. Change-Id: Ia94728ecead879c8d223eb6cee6c102a8af1c86e Reviewed-on: https://go-review.googlesource.com/c/147937 Reviewed-by:
Cherry Zhang <cherryyz@google.com>
-
- 09 Nov, 2018 1 commit
-
-
Ian Lance Taylor authored
This works around what appears to be a bug in current clang (2018-11-09). Details are in the comment in the code. Change-Id: Ib4783b6c03d531c69ebc4cb0ac023bea5bee7d40 Reviewed-on: https://go-review.googlesource.com/c/148819 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 26 Oct, 2018 1 commit
-
-
Than McIntosh authored
With https://golang.org/cl/135455, gccgo now uses a different mangling scheme for package paths; add code to use this new scheme for function and variable symbols. Since users sometimes use older versions of gccgo with newer versions of go, perform a test at runtime to see which mangling scheme is in effect for the version of 'gccgo' in the path. Updates #27534. Change-Id: If7ecab06a72e1361129fe40ca6582070a3e8e737 Reviewed-on: https://go-review.googlesource.com/c/144418 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 22 Oct, 2018 1 commit
-
-
Clément Chigot authored
This commit adds AIX operating system to cmd/cgo package for ppc64 architecture. It doesn't fully adapt cgo tool to AIX. But it allows to use go tool cgo -godefs which is really usefull for others packages. Update: #25893 Change-Id: I38e289cf0122d143ba100986d08229b51b03ddfc Reviewed-on: https://go-review.googlesource.com/c/138731 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 22 Aug, 2018 1 commit
-
-
Daniël de Kok authored
_GoStringLen performs an implicit conversion from intgo to size_t. Explicitly cast to size_t. This change avoids warnings when using cgo with CFLAGS: -Wconversion. Change-Id: I58f75a35e17f669a67f9805061c041b03eddbb5c GitHub-Last-Rev: b5df1ac0c3c90360fa1d22c069e0f126e9f894d8 GitHub-Pull-Request: golang/go#27092 Reviewed-on: https://go-review.googlesource.com/129820 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 31 Jul, 2018 1 commit
-
-
Kir Kolyshkin authored
Due to a new specification of //line: directives, missing column info is now treated as column 0, aka "unknown column" (see https://github.com/golang/go/issues/24183 for details). As cgo does not add column number to generated //line: directive, resulting files parsed do not have column info. Fix by adding column of 1 to generated line directives. Fixes #26692 Change-Id: Ie9263c0cf666b92d19c34240e745e8f32ffe7174 Reviewed-on: https://go-review.googlesource.com/126675 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 05 Jul, 2018 1 commit
-
-
Ian Lance Taylor authored
Otherwise it is possible that msan will consider the C result to be partially initialized, which may cause msan to think that the Go stack is partially uninitialized. The compiler will never mark the stack as initialized, so without this CL it is possible for stack addresses to be passed to msanread, which will cause a false positive error from msan. Fixes #26209 Change-Id: I43a502beefd626eb810ffd8753e269a55dff8248 Reviewed-on: https://go-review.googlesource.com/122196 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 02 Jul, 2018 1 commit
-
-
Peter Gonda authored
Allow static complication of cgo enabled libraries. Fixes #16651 Change-Id: I0729ee4e6e5f9bd1cbdb1bc2dcbfe34463df547c Reviewed-on: https://go-review.googlesource.com/89655 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 18 Jun, 2018 1 commit
-
-
Hiroshi Ioka authored
Use more cryptic names for local variables inside C function wrappers. Fixes #23356 Change-Id: Ia6a0218f27a13be14f589b1a0facc9683d22ff56 Reviewed-on: https://go-review.googlesource.com/86495 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by:
Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 01 Jun, 2018 1 commit
-
-
Tim Cooper authored
Each URL was manually verified to ensure it did not serve up incorrect content. Change-Id: I4dc846227af95a73ee9a3074d0c379ff0fa955df Reviewed-on: https://go-review.googlesource.com/115798 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
- 29 May, 2018 1 commit
-
-
Ian Lance Taylor authored
Change cgo to follow https://golang.org/s/generatedcode. For the C code we continue to use /* */ comments, so they don't follow the format exactly. It doesn't really matter since the format is only for Go code anyhow. This CL changes the C code to be similar for consistency. Fixes #25623 Change-Id: Idcfee53ec4069924d173ab8cedeb7bcfb7312863 Reviewed-on: https://go-review.googlesource.com/115035 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Tobias Klauser <tobias.klauser@gmail.com>
-
- 25 Apr, 2018 1 commit
-
-
Ian Lance Taylor authored
We were using absolute paths in the #line directives in the export header file. This makes the header file change if you move GOPATH. The absolute paths aren't helpful for the final user, which is some C program elsewhere. Fixes #24945 Change-Id: I2da32c9b477df578bd5087435a03fe97abe462e3 Reviewed-on: https://go-review.googlesource.com/108315 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 10 Jan, 2018 1 commit
-
-
Ian Lance Taylor authored
https://golang.org/cl/43970 changed writeOutputFunc to support niladic function-like macros; apply the corresponding change to writeGccgoOutputFunc. Updates #10715 Updates #18720 Change-Id: I5decb1d37ec71507466ade2eeda4b89c8785eaef Reviewed-on: https://go-review.googlesource.com/86475 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Hiroshi Ioka <hirochachacha@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Austin Clements <austin@google.com>
-
- 14 Dec, 2017 1 commit
-
-
Ian Lance Taylor authored
The export prologue goes into the _cgo_export.h file, where it may be be #include'd by a .swig file. As SWIG defines its own type "intgo", the definition of "intgo" in the export prologue could conflict. Since we don't need to define "intgo" in the _cgo_export.h file, don't. Defining "intgo" in _cgo_export.h was new for this release, so this should not break any existing code. No test case as I can't quite bring myself to write a test that combines SWIG and cgo. Change-Id: I8073e8300a1860cecd5994b9ad07dd35a4298c89 Reviewed-on: https://go-review.googlesource.com/83936 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 16 Nov, 2017 2 commits
-
-
Russ Cox authored
Passing the absolute path to cgo puts the absolute path in the generated file's //line directives, which then shows that path in the compiler output, which the go command can then make relative to the current directory, same as it does for other compiler output. Change-Id: Ia2064fea40078c46fd97e3a3b8c9fa1488f913e3 Reviewed-on: https://go-review.googlesource.com/77154 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Cgo has always operated by rewriting the AST and invoking go/printer. This CL converts it to use the AST to make decisions but then apply its edits directly to the underlying source text. This approach worked better in rsc.io/grind (used during the C to Go conversion) and also more recently in cmd/cover. It guarantees that all comments and line numbers are preserved exactly. This eliminates a lot of special concern about comments and problems with cgo not preserving meaningful comments. Combined with the CL changing cmd/cover to use the same approach, it means that the combination of applying cgo and applying cover still guarantees all comments and line numbers are preserved exactly. This sets us up to fix some cgo vs cover bugs by swapping the order in which they run during the go command. This also sets up #16623 a bit: the edit list being accumulated here is nearly exactly what you'd want to pass to the compiler for that issue. Change-Id: I7611815be22e7c5c0d4fc3fa11832c42b32c4eb3 Reviewed-on: https://go-review.googlesource.com/77153 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 15 Nov, 2017 1 commit
-
-
Ian Lance Taylor authored
Permit the C preamble to use the _GoString_ type. Permit Go code to pass string values directly to those C types. Add accessors for C code to retrieve sizes and pointers. Fixes #6907 Change-Id: I190c88319ec88a3ef0ddb99f342a843ba69fcaa3 Reviewed-on: https://go-review.googlesource.com/70890 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
Austin Clements <austin@google.com>
-
- 11 Sep, 2017 1 commit
-
-
Anthony Sottile authored
Fixes #21809 Change-Id: Ic43077c6bea3c7cdc9611e74abf07b6deab70433 Reviewed-on: https://go-review.googlesource.com/62670 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 30 Aug, 2017 1 commit
-
-
Hiroshi Ioka authored
Currently, cgo supports only macros which can be reduced to constants or variables. The CL addresses remaining parts, macros which can be represented as niladic functions. The basic idea is simple: 1. make a thin wrapper function per macros. 2. replace macro expansions with function calls. Fixes #10715 Fixes #18720 Change-Id: I150b4fb48e9dc4cc34466ef6417c04ac93d4bc1a Reviewed-on: https://go-review.googlesource.com/43970 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 16 Aug, 2017 1 commit
-
-
Michael Steinert authored
When calling a Go function that returns multiple values from C, cgo generates a structure to hold the values. According to the documentation this structure is called `struct <function-name>_return`. When compiling for gccgo the generated structure name is `struct <function-name>_result`. This change updates the output for gccgo to match the documentation and output for gc. Fixes #20910 Change-Id: Iaea8030a695a7aaf9d9f317447fc05615d8e4adc Reviewed-on: https://go-review.googlesource.com/49350 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 08 Aug, 2017 1 commit
-
-
Ian Lance Taylor authored
Fixes #18412 Change-Id: Ib457eeced7820517aa35df9e7dfda1c0de4ac004 Reviewed-on: https://go-review.googlesource.com/52852 Reviewed-by:
Avelino <t@avelino.xxx> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 26 May, 2017 1 commit
-
-
Ian Lance Taylor authored
Change-Id: I3b3ae4ecad0894781a3019326c7262cb9790ad4d Reviewed-on: https://go-review.googlesource.com/44250 Reviewed-by:
Bryan Mills <bcmills@google.com> Reviewed-by:
Dmitry Vyukov <dvyukov@google.com>
-
- 22 Apr, 2017 1 commit
-
-
Hiroshi Ioka authored
Change-Id: I9d399db8ac26ad44adeace3bf1e5b11cbfe3e0d3 Reviewed-on: https://go-review.googlesource.com/41313 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 21 Apr, 2017 1 commit
-
-
Hiroshi Ioka authored
Change-Id: I0f8c695146b39cff72ca2374f861f3e9f72b0f77 Reviewed-on: https://go-review.googlesource.com/41314 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 07 Apr, 2017 1 commit
-
-
Hiroshi Ioka authored
Current code doesn't support floating point #define macros. This CL compiles floats to a object file and retrive values from it. That approach is the same work as we've already done for integers. Updates #18720 Change-Id: I88b7ab174d0f73bda975cf90c5aeb797961fe034 Reviewed-on: https://go-review.googlesource.com/35511 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 11 Nov, 2016 1 commit
-
-
Ian Lance Taylor authored
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 <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-