invalid conversion from `int*' to `socklen_t*'

From: Abhijit Bhadra (abhijit.bhadra_at_ca.com)
Date: 11/29/04


Date: 29 Nov 2004 01:14:20 -0800

Hi ,
I am using gcc version 3.3.2. While compiling this code
struct sockaddr_in *CBaseSocket::GetSocketName()
{
        socklen_t iLen;
        cCriticalSocket.Lock();
                // Do we have a socket?
        if (sSocket == INVALID_SOCKET)
                {
                cCriticalSocket.Unlock();
                return(NULL);
                };
        cCriticalSocket.Unlock();

        iLen = sizeof(struct sockaddr_in);
        if (!::getsockname(sSocket, (struct sockaddr *) &sTAddr, &iLen))
                return(&sTAddr);

        return(NULL);
};

I am getting this error while compiling :

"invalid conversion from `int*' to `socklen_t*'"

Can anyone help me to get rid of this error message ?

Thanks,
Abhijit



Relevant Pages

  • Re: Function call before main.
    ... he said compiling it in gcc gave him the error message ... Isn't it just as valid to say "I was cooking dinner, ...
    (comp.lang.c)
  • Re: Function call before main.
    ... Kenneth Brody said: ... he said compiling it in gcc gave him the error message ...
    (comp.lang.c)
  • Re: byte alignment/dynamic memory from heap x64
    ... I had seen the definition in the WDK header that uses ... declspec) and I was compiling with x64 compiler. ... struct and when my driver is loaded I dynamically allocate memory using these ... The documention for x64 states that SLIST_ENTRY and SLIST_HEADER must be 16 ...
    (microsoft.public.development.device.drivers)
  • Possible issues with FC5s gcc
    ... I have been getting while compiling certain KDE modules from their SVN ... Not all code is ready for GCC>4, ... think posting your error message should be sufficient. ...
    (Fedora)
  • [PATCH] drm: Fixes error with gcc 3.3.5 in i915 driver.
    ... When compiling with gcc 3.3.5 I got the following error message in the ... This error did not occur when compiling the same code in gcc 4.3.2. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)