Compiler crash with Phoenix and PropertyTree.

Hello all,
I'm seeing a compiler crash (MSVC 8.0) with the following piece of code. I'm
using Boost.Phoenix along with Boost.PropertyTree
namespace pt = boost::property_tree ;
pt::ptree tree ;
boost::phoenix::bind (&pt::ptree::put

Surya Kiran Gullapalli wrote:
Hello all, I'm seeing a compiler crash (MSVC 8.0) with the following piece of code. I'm using Boost.Phoenix along with Boost.PropertyTree
namespace pt = boost::property_tree ; pt::ptree tree ; boost::phoenix::bind (&pt::ptree::put
, tree, string("Temp.Flag"), true) ; Attached is the build log.
Actually, this is a test program, I wrote to reproduce a C4180 warning, but I see a crash here (actually I see C4180 also)
Let me know if I'm doing something wrong.
It is always tough to find the problem when the compiler crashes. In cases like this, the first thing I do is test with a different compiler. In many cases the errors are revealed and fixing it will also fix the other compiler's problem. Not in all cases though. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon

Hello all, I'm seeing a compiler crash (MSVC 8.0) with the following piece of code. I'm using Boost.Phoenix along with Boost.PropertyTree
namespace pt = boost::property_tree ; pt::ptree tree ; boost::phoenix::bind (&pt::ptree::put
, tree, string("Temp.Flag"), true) ; I know of a VC8 crash using Boost.Bind when you forget to specify
Surya Kiran Gullapalli wrote: placeholders, i.e. code similar to void fn(int, int); boost::bind(&fn, 1); This could be something similar, perhaps. Sebastian

On Tue, Dec 15, 2009 at 14:15, Sebastian Redl wrote: Surya Kiran Gullapalli wrote: Hello all,
I'm seeing a compiler crash (MSVC 8.0) with the following piece of code.
I'm using Boost.Phoenix along with Boost.PropertyTree namespace pt = boost::property_tree ;
pt::ptree tree ;
boost::phoenix::bind (&pt::ptree::put With Gcc-4.2.2 , compilation fails with errors.
http://pastebin.com/m674d879c
http://pastebin.com/m674d879cI tried to sift thru the error log, but
overwhelmed with the number of errors.

Surya Kiran Gullapalli wrote:
On Tue, Dec 15, 2009 at 14:15, Sebastian Redl
mailto:sebastian.redl@getdesigned.at> wrote: Surya Kiran Gullapalli wrote:
Hello all, I'm seeing a compiler crash (MSVC 8.0) with the following piece of code. I'm using Boost.Phoenix along with Boost.PropertyTree
namespace pt = boost::property_tree ; pt::ptree tree ; boost::phoenix::bind (&pt::ptree::put
, tree, string("Temp.Flag"), true) ; With Gcc-4.2.2 , compilation fails with errors. http://pastebin.com/m674d879c
http://pastebin.com/m674d879cI tried to sift thru the error log, but overwhelmed with the number of errors.
Well, this is your error: /nfs/punlinuxvault1/fcdata5/data10/sgullapa/Packages/Boost-1.41.0/include/boost-1_41/boost/property_tree/detail/ptree_implementation.hpp:769: error: request for member 'put_value' in 'tr', which is of non-class type 'bool' Alas, I do not know enough of property_tree to know. I could help you more if you post a minimal cpp file I can try. What do you want to do BTW? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon

Thanks for pointing out the issue. Now the compiler crash is gone. I was calling a wrong function (silly me) What I was trying was to reproduce C4180 warning when using phoenix::bind. Here's a small test program to reproduce the warning. namespace pt = boost::property_tree ; pt::ptree tree ; // The following function translates to // tree.put("Temp.Flag", true) ; boost::phoenix::bind (&pt::ptree::put<bool>, tree, string("Temp.Flag"), true) ; what I wanted to know is whether the warning is harmless or not. Can i suppress the warning in compiler flags using /wd4180 without any issues ? Gcc compiles fine without any warnings. Surya

Surya Kiran Gullapalli wrote:
Thanks for pointing out the issue. Now the compiler crash is gone. I was calling a wrong function (silly me)
What I was trying was to reproduce C4180 warning when using phoenix::bind. Here's a small test program to reproduce the warning.
namespace pt = boost::property_tree ; pt::ptree tree ;
// The following function translates to // tree.put("Temp.Flag", true) ;
boost::phoenix::bind (&pt::ptree::put<bool>, tree, string("Temp.Flag"), true) ;
what I wanted to know is whether the warning is harmless or not. Can i suppress the warning in compiler flags using /wd4180 without any issues ? Gcc compiles fine without any warnings.
What is the warning? BTW, you might want to have a phoenix::ref around tree if you want to capture by reference. Phoenix always defaults to capture by value. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon

From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Surya Kiran Gullapalli Sent: Wednesday, December 16, 2009 2:35 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Compiler crash with Phoenix and PropertyTree. Thanks for pointing out the issue. Now the compiler crash is gone. I was calling a wrong function (silly me) What I was trying was to reproduce C4180 warning when using phoenix::bind. Here's a small test program to reproduce the warning. namespace pt = boost::property_tree ; pt::ptree tree ; // The following function translates to // tree.put("Temp.Flag", true) ; boost::phoenix::bind (&pt::ptree::put<bool>, tree, string("Temp.Flag"), true) ; what I wanted to know is whether the warning is harmless or not. Can i suppress the warning in compiler flags using /wd4180 without any issues ? Gcc compiles fine without any warnings. I’m sure you can ignore this warning. More significant (to me) is the Fear Uncertainty and Doubt that this spurious warning has caused you. If you had not been distracted by this warning(s), you might yourself have focussed on the real cause more quickly? (Saved yourself much time - and perhaps not bothered the busy author and cluttered the mailing list ;-) This is why I believe it is important to keep nagging to get Boost code free of warnings to the end user. https://svn.boost.org/trac/boost/wiki/Guidelines/MaintenanceGuidelines (I’m aware that part of the trouble is that compilers vary, so if the author doesn’t use the most paranoid compiler, he doesn’t feel the pain, but surely it still isn’t too much trouble to cure or suppress warnings like this?) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
participants (4)
-
Joel de Guzman
-
Paul A. Bristow
-
Sebastian Redl
-
Surya Kiran Gullapalli