This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3688: Somehow, an int is getting involved when getting sizeof a struct sockaddr variable.



>Number:         3688
>Category:       c++
>Synopsis:       Somehow, an int is getting involved when getting sizeof a struct sockaddr variable.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 14 16:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Joseph Pingenot
>Release:        GCC 3
>Organization:
>Environment:
Solaris 8, 04/01, all current recommended patch clusters installed.
>Description:
The following is generated when using gcc 3 on the most recent mozilla CVS archives.  It works just fine under gcc 2.95.2, same platform.
======
$make
Creating .deps
nsSocket.cpp
c++ -o nsSocket.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DOJI   -I../../../../dist/include -I../../../../dist/include -I/usr/local/src/building/mozilla/dist/include/nspr      -I/usr/openwin/include   -fPIC  -I/usr/openwin/include -fno-rtti -fno-exceptions -pedantic -Wno-long-long -pipe -pthreads -O3  -DNDEBUG -DTRIMMED -I/usr/openwin/include -DMOZILLA_CLIENT -include ../../../../config-defs.h -Wp,-MD,.deps/nsSocket.pp nsSocket.cpp
nsSocket.cpp: In member function `int nsSocket::SrvAccept()':
nsSocket.cpp:247: cannot convert `int*' to `socklen_t*' for argument `3' to 
   `int accept(int, sockaddr*, socklen_t*)'
nsSocket.cpp: In member function `int nsSocket::GetHostPortString(char**)':
nsSocket.cpp:463: cannot convert `int*' to `socklen_t*' for argument `3' to 
   `int getsockname(int, sockaddr*, socklen_t*)'
make: *** [nsSocket.o] Error 1
====
The first error is generated by the following member function:
====
  237  nsSocket::SrvAccept()
   238  {
   239      int rv = OK;
   240      struct sockaddr cliaddr;
   241      socklen_t clilen;
   242  
   243      if (mListenFd < 0)
   244          return E_PARAM;
   245  
   246      clilen = sizeof(cliaddr);
   247      mFd = accept(mListenFd, (struct sockaddr *) &cliaddr, &clilen);
   248      if (mFd < 0)
   249          rv = E_ACCEPT;
   250  
   251      return rv;
   252  }
====
>How-To-Repeat:
Grab the latest cutting-edge Mozilla source and configure with GCC 3.
Then go into xpinstall/wizard/libxpnet/src and try to make.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]