[haiku-development] Changing dladdr() to take const void* for first parameter

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 6 Nov 2011 00:53:08 -0400

I was compiling the Ruby implementation called Rubinius on Haiku and
had an error in a call to dladdr. They were passing a const void* but
our dladdr takes a void* [1]. I looked online and FreeBSD [2] and Mac
OS X [3] both take const void*.

Further discussion with someone in the #rubinius IRC channel indicated
that this function is not POSIX and it started in Solaris where the
first param was not const. But at some point FreeBSD must have made it
const and Mac OS X followed suit. I believe it is const in Linux too.

I looked through the code that implements dladdr in the runtime_loader
and it seems like having a const all the way through the call chain
would be fine.

So can we change it?

1. http://dev.haiku-os.org/browser/haiku/trunk/headers/posix/dlfcn.h
2. http://www.freebsd.org/cgi/man.cgi?query=dladdr&sektion=3
3. 
http://developer.apple.com/library/ios/#documentation/system/conceptual/manpages_iphoneos/man3/dladdr.3.html

-- 
Regards,
Ryan

Other related posts: