Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2000 01:24:58 +0400 (MSD)
From:      "Aleksandr A.Babaylov" <babolo@links.ru>
To:        chris@calldei.com
Cc:        msmith@FreeBSD.ORG, dcs@newsguy.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: malloc to arrays?
Message-ID:  <200008032124.BAA04719@aaz.links.ru>
In-Reply-To: <20000802192020.A386@holly.calldei.com> from "Chris Costello" at "Aug 2, 0 07:20:20 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Chris Costello writes:
> On Wednesday, August 02, 2000, Mike Smith wrote:
> > 	tcpcash_addr = (typeof(tcpcash_addr))
> > 			malloc(sizeof(*tcpcash_addr) * 
> > 				TCPCASH_ROWSIZE * 
> > 				TCPCASH_COOLSIZE);
>    Just as a note on coding style, this will only hide warnings
> caused by not including <stdlib.h>.  malloc(3) returns void * and
> does not need to be cast.
So there is an error in gcc in base system?
See:

1cicuta~/w/ra-tools(6)>cat tmp.c
#include <stdlib.h>

int main()
{   int *(i[100]);

    i = malloc(400);
}
0cicuta~/w/ra-tools(7)>cc tmp.c
tmp.c: In function `main':
tmp.c:6: incompatible types in assignment
1cicuta~/w/ra-tools(8)>uname -a
FreeBSD cicuta.babolo.ru 4.0-STABLE FreeBSD 4.0-STABLE #0: Fri Jun  9 14:01:52 MSD 2000     babolo@cicuta.babolo.ru:/tmp/obj/usr/src/sys/cicuta  i386
0cicuta~/w/ra-tools(9)>

-- 
@BABOLO      http://links.ru/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008032124.BAA04719>