Opened 8 years ago

Last modified 8 years ago

#10325 new Bugs

Win32: including file_lock.hpp results in compilation error

Reported by: anonymous Owned by: Ion Gaztañaga
Milestone: Boost 1.57.0 Component: interprocess
Version: Boost 1.56.0 Severity: Problem
Keywords: interprocess, file_lock Cc:

Description

Today I switched from Boost 1.55.0 to 1.56.0 and now get the following error just for including file_lock.hpp:

error: invalid conversion from 'boost::interprocess::winapi::farproc_t {aka int (attribute((stdcall)) *)()}' to 'void*' [-fpermissive]

In file included from d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\errors.hpp:37:0,
                 from d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\exceptions.hpp:20,
                 from d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\sync\file_lock.hpp:20,
                 from src\init.cpp:38:
d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\detail\win32_api.hpp: In instantiation of 'static void* boost::interprocess::winapi::function_address_holder<Dummy>::get(unsigned int) [with int Dummy = 0]':
d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\detail\win32_api.hpp:1614:20:   required from here
d:\mingw\mingw32\i686-w64-mingw32\include\boost\interprocess\detail\win32_api.hpp:1541:31: error: invalid conversion from 'boost::interprocess::winapi::farproc_t {aka int (__attribute__((__stdcall__)) *)()}' to 'void*' [-fpermissive]
       return FunctionAddresses[id];
                               ^

Used compiler: gcc version 4.8.1 (rev5, Built by MinGW-W64 project)

OS: Win8.1 x64

IDE: Qt Creator 3.1.2 (Qt 5.3.1)

I verified that the project compiles fine, if the file_lock stuff is commented out. I'm going to watch this thread, so I don't supply my email address.

Change History (4)

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

This should be fixed in both develop and master branches, sadly it wasn't in time for Boost 1.56.

comment:2 by dmitry.s.petrov@…, 8 years ago

Hi guys,

It there any workaround or patch for this issue except downgrading to 1.55?

Thanks in advance, Dmitry

comment:3 by anonymous, 8 years ago

Just wanted to confirm the problem also on Win XP GCC 4.8.1 (no MSYS). Excluding the file 'file_lock.hpp' by using the command line option -DBOOST_INTERPROCESS_FILE_LOCK_HPP did not help as similar problem pops up in 'win32_api.hpp'. Downgrading to Boost 1.55.0 solved the issue.

--Nik

comment:4 by Ion Gaztañaga, 8 years ago

A fix for this didn't enter in Boost 1.56 release timeline but it should be fixed in the develop branch. You might want to replace your file with

http://www.boost.org/doc/libs/develop/boost/interprocess/detail/win32_api.hpp

and test if the bug was corrected.

Note: See TracTickets for help on using tickets.