Boost logo

Boost Users :

From: Richard Hadsell (hadsell_at_[hidden])
Date: 2004-05-01 17:20:32


Richard Hadsell wrote:

> Markus Schöpflin wrote:
>
>> - When compiling boost you will see several warnings (and one error!)
>> about the use of assert on pointer types. These are caused by a bug
>> in the system header files which force the argument for assert() to
>> int. This can be fixed by editing the header file
>> "/usr/include/assert.h".
>
> Thanks for the tips. With regard to this one, was your fix to (a)
> change the cast to bool, (b) change the cast to long, or (c) just
> eliminate the cast and let the compiler convert to bool?

Never mind. I decided to fix the assert complaints by modifying
boost/regex/v4/perl_matcher_non_recursive.hpp. I prefer that to
modifiying a system header on every machine and for any future upgrades
(unlikely as they are at this point). I changed all the asserts with an
argument of just a pointer to compare the pointer to 0, thus producing a
valid bool. E.g.:

assert(rep->next.p); => assert(rep->next.p != 0);

I don't think Boost developers (i.e., John Maddock) would mind. Do you
think they (i.e., he) might even accept this as an improvement?

-- 
Dick Hadsell			914-259-6320  Fax: 914-259-6499
Reply-to:			hadsell_at_[hidden]
Blue Sky Studios                http://www.blueskystudios.com
44 South Broadway, White Plains, NY 10601

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net