__fastcall warning when compiling boost in managed c++

Hi, I am handling some project which mixes managed and unmanaged C++ code. With boost 1.33 I’m hitting problems with the header is_mem_fun_pointer_tester.hpp. There are warnings popping up due to the use of __fastcall calling convertion in boost and its incompatible with compiling some of our code with the /clr flag turned on. Managed C++ is incompatible with the __fastcall calling convention because what it does is it preloads certain registers with the function parameters but for /clr compilation it is compiling to MSIL so this cannot be done and upon encountering any __fastcall the Managed C++ compiler will change it to __stdcall. Does anyone know the implications of disabling these warnings and whether it is safe to do that? I did not get these warnings with the previous versions of boost though. Thanks and regards, Chu-Ming

ChuMing wrote:
There are warnings popping up due to the use of __fastcall calling convertion in boost and its incompatible with compiling some of our code with the /clr flag turned on. Managed C++ is incompatible with the __fastcall calling convention because what it does is it preloads certain registers with the function parameters but for /clr compilation it is compiling to MSIL so this cannot be done and upon encountering any __fastcall the Managed C++ compiler will change it to __stdcall.
Does anyone know the implications of disabling these warnings and whether it is safe to do that? I did not get these warnings with the previous versions of boost though.
It's completely safe to suppress those warnings in this case: the code is there just to detect whether __fastcall functions are functions or not. If they're not supported with managed code, no harm will come to you from this. Long term we should bracket the __fastcall bit in #ifndef _MANAGED guards. John.

Thanks alot John!=]

ChuMing wrote:
Hi,
I am handling some project which mixes managed and unmanaged C++ code. With boost 1.33 I’m hitting problems with the header is_mem_fun_pointer_tester.hpp.
Do you have a test case for this: I've been trying to reproduce the warning but can't find an example that triggers it, *unless* the template argument is a __fastcall qualified function itself. The test code in is_mem_fun_pointer_tester.hpp never seems to generate a warning in itself as far as I can tell at present? Thanks, John.
participants (2)
-
ChuMing
-
John Maddock