.P
.in +4n
.EX
-.BI "int __clone2(int (*" "fn" ")(void *),"
+.BI "int __clone2(typeof(int (void *)) *" fn ,
.BI " void *" stack_base ", size_t " stack_size ,
.BI " int " flags ", void *" "arg" ", ..."
.BI " \fR/*\fP pid_t *" parent_tid ", struct user_desc *" tls ,
struct module_symbol *syms;
struct module_ref *deps;
struct module_ref *refs;
- int (*init)(void);
- void (*cleanup)(void);
+ typeof(int (void)) *init;
+ typeof(void (void)) *cleanup;
const struct exception_table_entry *ex_table_start;
const struct exception_table_entry *ex_table_end;
#ifdef __alpha__
.P
.in +4n
.EX
-.BI "void ( *" signal "(int " signum ", void (*" handler ")(int)) ) (int);"
+.BI "typeof(void (int)) *signal(int " signum ", typeof(void (int)) *" handler );
.EE
.in
.SS Portability
main(void)
{
void *handle;
- double (*cosine)(double);
+ typeof(double (double)) *cosine;
char *error;
\&
handle = dlopen(LIBM_SO, RTLD_LAZY);
\&
dlerror(); /* Clear any existing error */
\&
- cosine = (double (*)(double)) dlsym(handle, "cos");
+ cosine = (typeof(double (double)) *) dlsym(handle, "cos");
\&
/* According to the ISO C standard, casting between function
pointers and \[aq]void *\[aq], as done above, produces undefined results.
.P
.in +4n
.EX
-void (*__malloc_initialize_hook)(void) = my_init_hook;
+typeof(void (void)) *__malloc_initialize_hook = my_init_hook;
.EE
.in
.P
static void *my_malloc_hook(size_t, const void *);
\&
/* Variables to save original hooks */
-static void *(*old_malloc_hook)(size_t, const void *);
+static typeof(void *(size_t, const void *)) *old_malloc_hook;
\&
/* Override initializing hook from the C library */
-void (*__malloc_initialize_hook)(void) = my_init_hook;
+typeof(void (void)) *__malloc_initialize_hook = my_init_hook;
\&
static void
my_init_hook(void)
.EX
.BI "typedef int " bool_t ;
.P
-.BI "typedef bool_t (*" xdrproc_t ")(XDR *, void *, ...);"
+.BI "typedef typeof(bool_t (XDR *, void *, ...)) *" xdrproc_t ;
.P
-.BI "typedef bool_t (*" resultproc_t ")(caddr_t " resp ,
-.BI " struct sockaddr_in *" raddr );
+.BI "typedef typeof(bool_t (caddr_t " resp ", struct sockaddr_in *" raddr )
+.BI " *" resultproc_t ;
.EE
.RE
.P
.P
.nf
.BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum ,
-.BI " unsigned long " procnum ", char *(*" procname ")(char *),"
+.BI " unsigned long " procnum ", typeof(char *(char *)) *" procname ,
.BI " xdrproc_t " inproc ", xdrproc_t " outproc );
.fi
.IP
.nf
.BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum ,
.BI " unsigned long " versnum ,
-.BI " void (*" dispatch ")(struct svc_req *, SVCXPRT *),"
+.BI " typeof(void (struct svc_req *, SVCXPRT *)) *" dispatch ,
.BI " unsigned long " protocol );
.fi
.IP
.EX
.BI "typedef int " bool_t ;
.P
-.BI "typedef bool_t (*" xdrproc_t ")(XDR *, void *,...);"
+.BI "typedef typeof(bool_t (XDR *, void *, ...)) *" xdrproc_t ;
.EE
.RE
.P
.nf
.BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize ,
.BI " unsigned int " recvsize ", char *" handle ,
-.BI " int (*" readit ")(char *, char *, int),"
-.BI " int (*" writeit ")(char *, char *, int));"
+.BI " typeof(int (char *, char *, int)) *" readit ,
+.BI " typeof(int (char *, char *, int)) *" writeit );
.fi
.IP
This routine initializes the XDR stream object pointed to by