From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199707220341.VAA16915@ellpspace.math.ualberta.ca> Date: Mon, 21 Jul 1997 21:41:05 -0600 (MDT) From: Michal Jaegermann Subject: Re: libc In-Reply-To: <33D4B218.7137@home.com> > > I am running RedHat-4.2 an an Alpha box. The problem is with libc. > Whenever I compile something with socket code I get warnings about > incompatable pointer types in accept() and a few other important calls. Never, NEVER, provide your own declarations for functions declared in system headers. > The network functions in question use size_t rather then int as > they should. Headers, i.e. say: extern int __connect __P ((int __fd, __CONST_SOCKADDR_ARG __addr, size_t __len)); extern int connect __P ((int __fd, __CONST_SOCKADDR_ARG __addr, size_t __len)); while indeed manpage says that the third argument is int. But system headers have a precedence. This is what libraries really expect. The same goes for other socket functions. > This causes some > network programs to be really broken. Not really. If you avoid shoddy programming practices and include proper headers, instead of second-guessing them, they work like advertised. I strongly suspect that size_t above is a POSIX requirement although I do not know that for sure. Anybody can confirm/refute? Manpages indeed should be fixed to agree with what is in headers. Michal -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com