Opened 12 years ago

Closed 12 years ago

#4815 closed Bugs (invalid)

dependency on obsolete versions of mmap and shmdt

Reported by: stephen.clamage@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

Compiler error messages when compiling on Solaris:
"../../../boost/interprocess/mapped_region.hpp", line 549: Error: Formal argument 1 of type char* in call to shmdt(char*) is being passed void*.
"../../../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*.

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.

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.

Change History (1)

comment:1 by Ion Gaztañaga, 12 years ago

Resolution: invalid
Status: newclosed

Sorry but the POSIX standard interface is void*:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/shmdt.html

int shmdt(const void *shmaddr);

http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html

void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);

Note: See TracTickets for help on using tickets.