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;
foo(&myvalue);

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 ♦♦
6091318
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×2
×1

question asked: 20 Mar '14, 08:17

question was seen: 2,643 times

last updated: 21 Mar '14, 15:23

powered by OSQA