There are some software like openldap and mozilla LDAP c-sdk which use void* in function parameter. There I have the problem that long values not correct transmitted. e.g. this part of code will fail on Solaris Sparc compiled with Solaris Studio 12.3.

int foo(void* vp){
    long value;

    value = *(long*)vp;

long myvalue = 0;

Anybody has seen this problem also. How can I handle this without to change the interface of foo()?

This question is marked "community wiki".

asked 20 Mar '14, 08:17

cgrzemba's gravatar image

cgrzemba ♦♦
accept rate: 9%

edited 20 Mar '14, 09:01

The example above works. The problem which I have use the data type LBER_SOCKET where has different definitions in openLDAP (int), Mozilla LDAP (long) or simply defined as int. If transfered an int via (void*) in a function which expect long than BUS ERROR's occur.

(21 Mar '14, 15:23) cgrzemba ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 20 Mar '14, 08:17

question was seen: 3,093 times

last updated: 21 Mar '14, 15:23

powered by OSQA