This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gccgo branch and darwin
- From: Ian Lance Taylor <iant at google dot com>
- To: Arnaud Lacombe <lacombar at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 01 Dec 2010 14:10:08 -0800
- Subject: Re: gccgo branch and darwin
- References: <20101119195558.GA18808@bromo.med.uc.edu> <AANLkTimq5aDWPj7Bi8kT_ACUbK8XAx39QZWOha5nCt0z@mail.gmail.com> <AANLkTimn7eO7KGNgdskpFwOLP_XjPLZ5q3WvGMNnmP9R@mail.gmail.com> <AANLkTi=_BmJtRdPQJo6=9SOcoUHnFVeX_ytaeKvxj=kc@mail.gmail.com> <AANLkTimHfa479WeEmGLrGeCCkY_ODKEq2r0JsAdk4zh1@mail.gmail.com>
Arnaud Lacombe <lacombar@gmail.com> writes:
> On Fri, Nov 19, 2010 at 11:58 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> sysinfo.go:2874:13: error: use of undefined type 'func___sighandler_t'
>>
> gen-sysinfo.go has :
>
> // type ___sighandler_t func*(int32)
That is not valid Go, so this looks like a bug in godump.c. What does
the type __sighandler_t look like in the .h file?
On GNU/Linux it looks like this in the .h file:
typedef void (*__sighandler_t) (int);
and I get this in gen-sysinfo.go:
type ___sighandler_t func(int32)
Thanks.
> I have not been able to find much
> info on function pointer in the specs, but I certainly did not look at
> the right place.
In Go a function type is written simply as
func(PARAMETER-TYPES) RESULT-TYPES
This is the type which in C would be called a pointer to function type.
Go does not have any type which corresponds to the C function type, as
opposed to the C pointer to function type.
Ian