This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gofrontend-dev] [PATCH 1/2, libgo] Add reflection support to gccgo for ppc64, ppc64le in gcc 4.9


On Wed, Jan 7, 2015 at 4:39 PM, Michael Hudson-Doyle
<michael.hudson@canonical.com> wrote:
> Ian Lance Taylor <iant@golang.org> writes:
>
>> On Wed, Jan 7, 2015 at 9:26 AM, Lynn A. Boger
>> <laboger@linux.vnet.ibm.com> wrote:
>>>
>>> In libgo/go/reflect/makefunc.go, calls to MakeFunc, makeMethodValue and
>>> makeValueMethod will panic if called when GOARCH is ppc64 or ppc64le.
>>
>> Right, I'm just saying that almost no code actually does that.  I just
>> tried a web search and found no uses other than examples of how to use
>> it.  I'm sure there are a few, but not many.
>
> There is a somewhat hidden one in Docker:
>
>     https://github.com/docker/docker/blob/master/api/client/cli.go#L64
>
> (it is also possible to patch docker to do this differently, of course).

Ah, so that is why it matters.

Perhaps you could talk Docker into replace the return statement with

return func(a ...string) error {
	return method.CallSlice([]reflect.Value{reflect.ValueOf(a)})[0].Interface().(error)
}, true

It would probably be just as efficient.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]