On Fri, 4 Aug 2000, Aleksandr A.Babaylov wrote:

> 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     [EMAIL PROTECTED]:/tmp/obj/usr/src/sys/cicuta  i386
> 0cicuta~/w/ra-tools(9)>

    There's no error at all.  You've declared i to be an array of 100
pointers to int, but then you've tried to assign a pointer to that
array, and gcc quite naturally complains.

-- 
Chris BeHanna
Software Engineer (at yourfit.com)
[EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to