[type_traits][regex] VC++ __fastcall /clr

Since no one responded to this in the boost user group, I will post it here in this group. When compiling managed code in VC++ .NET, which is any of the /clr compiler options, the programmer can mix both CLR classes and regular C++ classes. In the regular C++ classes, Boost should work fine. The VC++ macro which tells one that managed code of any kind is being compiled is _MANAGED, which is defined if managed code is being compiled else it is not defined. So when any of the /clr compiler options are being used _MANAGED is defined, else it is not defined. The VC++ compiler issues compiler warning C4561 whenever managed code is being compiled and __fastcall shows up as a calling convention in any way. Obviously the programmer can turn off this warning via a VC++ #pragma, but I am wondering if Boost could not change some of its headers to avoid this warning. In Boost bind and mem_fn, the programmer has to specifically ask for __fastcall support via special Boost macros to have any functions declared with the __fastcall calling convention, so nothing should be done there since it is clearly a programming error if he does so while compiling managed code. However there are two other places in Boost which I have discovered where functions with the __fastcall calling convention are declared without the programmer doing anything. The first, and most cumbersome reagrding warning messages, is in type_traits in the helper header files type_traits\detail\is_mem_fun_pointer_tester.hpp and type_traits\detail\is_function_pointer_tester.hpp. Since many other libraries, lambda in my case recently, uses type_traits, might not these headers be changed so that when VC++ is the compiler and _MANAGED is defined, the __fastcall versions of these helper functions are not declared ? The second, which I have not encountered but which I saw while searching through Boost header code, is in regex\config.h and I do not know, given some other macros there, whether BOOST_REGEX_CALL can ever be __fastcall when compiling with /clr, but if it can perhaps a change can be made there also. I know that it is not the purpose of Boost to try to accomodate C++ .NET programmers creating /clr compilations using Boost, especially when just warnings and not errors are issued. But in this case, using the predefined macro _MANAGED in VC++ and BOOST_MSVC, it would seem this acoomodation could be made. So I would like the Boost developers of type_traits, especially since it is used by so many other Boost libraries, and regex to consider it.

I would like to see this as well. The volume of warnings is pretty shocking when including Boost from MC++, C++/CLI, or even simply VC 8.0 compiling to native code. Dave Moore On 3/30/06, Edward Diener <eddielee@tropicsoft.com> wrote:
Since no one responded to this in the boost user group, I will post it here in this group.
When compiling managed code in VC++ .NET, which is any of the /clr compiler options, the programmer can mix both CLR classes and regular C++ classes. In the regular C++ classes, Boost should work fine. The VC++ macro which tells one that managed code of any kind is being compiled is _MANAGED, which is defined if managed code is being compiled else it is not defined. So when any of the /clr compiler options are being used _MANAGED is defined, else it is not defined.
The VC++ compiler issues compiler warning C4561 whenever managed code is being compiled and __fastcall shows up as a calling convention in any way. Obviously the programmer can turn off this warning via a VC++ #pragma, but I am wondering if Boost could not change some of its headers to avoid this warning. In Boost bind and mem_fn, the programmer has to specifically ask for __fastcall support via special Boost macros to have any functions declared with the __fastcall calling convention, so nothing should be done there since it is clearly a programming error if he does so while compiling managed code.
However there are two other places in Boost which I have discovered where functions with the __fastcall calling convention are declared without the programmer doing anything.
The first, and most cumbersome reagrding warning messages, is in type_traits in the helper header files type_traits\detail\is_mem_fun_pointer_tester.hpp and type_traits\detail\is_function_pointer_tester.hpp. Since many other libraries, lambda in my case recently, uses type_traits, might not these headers be changed so that when VC++ is the compiler and _MANAGED is defined, the __fastcall versions of these helper functions are not declared ?
The second, which I have not encountered but which I saw while searching through Boost header code, is in regex\config.h and I do not know, given some other macros there, whether BOOST_REGEX_CALL can ever be __fastcall when compiling with /clr, but if it can perhaps a change can be made there also.
I know that it is not the purpose of Boost to try to accomodate C++ .NET programmers creating /clr compilations using Boost, especially when just warnings and not errors are issued. But in this case, using the predefined macro _MANAGED in VC++ and BOOST_MSVC, it would seem this acoomodation could be made. So I would like the Boost developers of type_traits, especially since it is used by so many other Boost libraries, and regex to consider it.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

John Maddock wrote:
Since no one responded to this in the boost user group, I will post it here in this group.
Seen it, fixed the code on my machine, but can't access to cvs to commit the changes, which is why I hadn't replied....
Thanks, John. It will make it easier for developers creating managed code using VC++ and Boost not to get the warning message I described.

John Maddock wrote:
Since no one responded to this in the boost user group, I will post it here in this group.
Seen it, fixed the code on my machine, but can't access to cvs to commit the changes, which is why I hadn't replied....
I think CVS on sourceforge is working again but this has not been updated yet to my knowledge.

Edward Diener wrote:
John Maddock wrote:
Since no one responded to this in the boost user group, I will post it here in this group.
Seen it, fixed the code on my machine, but can't access to cvs to commit the changes, which is why I hadn't replied....
I think CVS on sourceforge is working again but this has not been updated yet to my knowledge.
Oh yes it has :-) It appears that anonymous cvs access and the html cvs access is way out of date, the current revision for boost/regex/config.hpp is: /config.hpp/1.65/Thu Mar 30 11:22:45 2006// But http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/regex/config.hpp shows the most recent revision was eight months ago ! John.

John Maddock wrote:
Edward Diener wrote:
John Maddock wrote:
Since no one responded to this in the boost user group, I will post it here in this group. Seen it, fixed the code on my machine, but can't access to cvs to commit the changes, which is why I hadn't replied.... I think CVS on sourceforge is working again but this has not been updated yet to my knowledge.
Oh yes it has :-)
It appears that anonymous cvs access and the html cvs access is way out of date, the current revision for boost/regex/config.hpp is:
/config.hpp/1.65/Thu Mar 30 11:22:45 2006//
But http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/regex/config.hpp shows the most recent revision was eight months ago !
I understand. It appears that sourceforge anonymous cvs is still broken. Is there any other way for me to get the latest version of boost via cvs ? What is html cvs access ?

But http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/regex/config.hpp shows the most recent revision was eight months ago !
I understand. It appears that sourceforge anonymous cvs is still broken. Is there any other way for me to get the latest version of boost via cvs ? What is html cvs access ?
Click on the link above for the html view of cvs: but it's just showing the anomymous cvs access which appears to be at least a month out of date. Otherwise you need developer access so you can access the cvs directly. John.

John Maddock wrote:
But http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/regex/config.hpp shows the most recent revision was eight months ago ! I understand. It appears that sourceforge anonymous cvs is still broken. Is there any other way for me to get the latest version of boost via cvs ? What is html cvs access ?
Click on the link above for the html view of cvs: but it's just showing the anomymous cvs access which appears to be at least a month out of date. Otherwise you need developer access so you can access the cvs directly.
Yes, it's completely out of date. OK, I guess I will just have to wait for the next release since access of CVS on sourceforge is incorrect whether one uses the html access or anonymous access from a CVS client like Tortoise CVS.

Yes, it's completely out of date. OK, I guess I will just have to wait for the next release since access of CVS on sourceforge is incorrect whether one uses the html access or anonymous access from a CVS client like Tortoise CVS.
If you're really desperate drop me a private email and I'll zip up the current regex sources for you. John.
participants (3)
-
Dave Moore
-
Edward Diener
-
John Maddock