Chris Costello wrote:
> On Wednesday, August 02, 2000, .@babolo.ru wrote:
> > Sorry I have no other direction to ask this:
> > I have declaration:
> > u_int32_t *(tcpcash_addr);
> > and want malloc some memory for tcpcash_addr:
> > tcpcash_addr = (typeof(tcpcash_addr))malloc(u_int32_t * 256 * n);
> > and have an error:
> > ra-sum.c:386: cast specifies array type
> > *** Error code 1
> Try this:
> u_int32_t *tcphash_haddr;
> tcphash_addr = malloc(sizeof(*tcphash_addr) * 256);
> You shouldn't be casting malloc and I don't see any reason
> to use *(foo[nmemb]) syntax.
>From the code, it's a variable-sized array of fixed-sized arrays.
Daniel C. Sobral (8-DCS)
Satan was once an angel, Gates started by writing a BASIC interpreter.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message