Re: malloc error on pointer
From: Martin Ambuhl (mambuhl_at_earthlink.net)
Date: 03/30/05
- Next message: baumann.Pan_at_gmail.com: "what's the two !! usage?"
- Previous message: Ben Pfaff: "Re: malloc error on pointer"
- In reply to: jt: "malloc error on pointer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Mar 2005 01:50:24 GMT
jt wrote:
> Looks good to me, I don't understand whey the error below. Any reasons why
> this would fail to compile.
>
> Running on AIX using the CC compiler.
>
> struct sockaddr *cliaddr;
>
> "tcpserver.c", line 88.10: 1506-068 (W) Operation between types "struct
> sockaddr *" and "int" is not allowed.
> cliaddr=malloc(addrlen); //<---------this is the error
You forgot to
#include <stdlib.h>
so the (pre-C99) assumption that undeclared functions return ints.
- Next message: baumann.Pan_at_gmail.com: "what's the two !! usage?"
- Previous message: Ben Pfaff: "Re: malloc error on pointer"
- In reply to: jt: "malloc error on pointer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|