From owner-freebsd-hackers Thu Aug 3 14:25:29 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from aaz.links.ru (aaz.links.ru [193.125.152.37]) by hub.freebsd.org (Postfix) with ESMTP id 3500337B588; Thu, 3 Aug 2000 14:25:22 -0700 (PDT) (envelope-from babolo@links.ru) Received: (from babolo@localhost) by aaz.links.ru (8.9.3/8.9.3) id BAA04719; Fri, 4 Aug 2000 01:24:58 +0400 (MSD) Message-Id: <200008032124.BAA04719@aaz.links.ru> Subject: Re: malloc to arrays? In-Reply-To: <20000802192020.A386@holly.calldei.com> from "Chris Costello" at "Aug 2, 0 07:20:20 pm" To: chris@calldei.com Date: Fri, 4 Aug 2000 01:24:58 +0400 (MSD) Cc: msmith@FreeBSD.ORG, dcs@newsguy.com, freebsd-hackers@FreeBSD.ORG From: "Aleksandr A.Babaylov" MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 . 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 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