Boost C++ Libraries: Ticket #4815: dependency on obsolete versions of mmap and shmdt https://svn.boost.org/trac10/ticket/4815 <p> Compiler error messages when compiling on Solaris: <br /> "../../../boost/interprocess/mapped_region.hpp", line 549: Error: Formal argument 1 of type char* in call to shmdt(char*) is being passed void*. <br /> "../../../boost/interprocess/anonymous_shared_memory.hpp", line 87: Error: Formal argument 1 of type char* in call to mmap(char*, unsigned, int, int, int, long) is being passed void*. </p> <p> The problem is that the calls to shmdt and mmap depend on passing a void*. In the obsolete XPG4 version of Unix (roughly POSIX.2a-1992), these functions indeed took a void* argument. In all later versions of standard Unix, these functions take a char* argument. Portable code therefore cannot depend on passing a void*, but can depend on passing a char* to these functions. </p> <p> The offending code should be changed either to pass a char* argument, or the argument should be cast to char* at the point of the call. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4815 Trac 1.4.3 Ion Gaztañaga Fri, 01 Apr 2011 17:57:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4815#comment:1 https://svn.boost.org/trac10/ticket/4815#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Sorry but the POSIX standard interface is void*: </p> <p> <a class="ext-link" href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/shmdt.html"><span class="icon">​</span>http://pubs.opengroup.org/onlinepubs/9699919799/functions/shmdt.html</a> </p> <p> int shmdt(const void *shmaddr); </p> <p> <a class="ext-link" href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html"><span class="icon">​</span>http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html</a> </p> <p> void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); </p> Ticket