RSPlib Discussions

Text archives Help


Re: [RSPlib-Discusssion] compilation problems


Chronological Thread 
  • From: Thomas Dreibholz <dreibh AT exp-math.uni-essen.de>
  • To: "Marjan Bozinovski" <marjanb AT cpk.auc.dk>, <rsplib-discussion AT sctp.de>
  • Subject: Re: [RSPlib-Discusssion] compilation problems
  • Date: Thu Oct 24 15:52:01 2002
  • List-id: RSPlib Discussions <rsplib-discussion.sctp.de>
  • Organization: University of Essen, Institute for Experimental Mathematics

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 24. Oktober 2002 14:16 schrieb Marjan Bozinovski:
> Hi Thomas,
>
> I have tried to make a SIP PE, but when compiling with gmake I get the
> following error:
>
> "ANSI C++ forbids implicit conversion from `void *' in assignment"
>
> due to the following line contained in the function initAll() taken from
> examplepe.c: eai2->ai_addr = memdup(&localAddressArray[i],sizeof(struct
> sockaddr_storage));
>
> This is the only error I've got. What does this mean and what did I do
> wrong?

memdup() returns a pointer of the type void*, that is a pointer of
unspecified type. eai2->ai_addr is a pointer to struct sockaddr_storage. The
C++ compiler assumes that both pointers are incompatible and generates an
error.

You simply need a cast and it will work:
eai2->ai_addr = (struct
sockaddr_storage*)memdup(&localAddressArray[i],sizeof(struct
sockaddr_storage));

This cast should also have been in examplepe.c. It will be there in the next
version.


Best regards
- --
=======================================================================
Dipl.-Inform. Thomas Dreibholz

University of Essen, Room ES210
Inst. for Experimental Mathematics Ellernstraße 29
Computer Networking Technology Group D-45326 Essen/Germany
- -----------------------------------------------------------------------
E-Mail:
dreibh AT exp-math.uni-essen.de
Homepage: http://www.exp-math.uni-essen.de/~dreibh
=======================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9t/p432BbsHYPLWURAp85AJ9QH+OsDCckRg4pnhT7MRT5ZQZySwCff56B
Ac0+4xP0Tgs/M8R5Pmcq1mA=
=HLv0
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.19+.

Top of page