Re: Compiling PowerLoom C++

Cameron Ross <[email protected]> Sun, 14 Feb 2010 08:17:45 -0500
Newsgroups gmane.comp.ai.powerloom
Message-ID <3485456149923388958@unknownmsgid>
Hi Thomas,

Yes.  This is an error that is halting compilation.  What are the
options to fix?  Will I have to modify the code manually?

Thanks,
Cameron

Sent from my iPhone

On Feb 14, 2010, at 5:47 AM, Thomas Russ <[email protected]> wrote:

>
> On Feb 14, 2010, at 4:40 AM, Cameron Ross wrote:
>
>> Hello,
>>
>> I'm trying the compile the C++ version of PowerLoom version
>> 3.2.52.  Running make from .../native/cpp/stella gives copious
>> errors similar to: hierarchy.cc:97: error: cast from =91stella::Obje
>> ct*=92 to =91stella::boolean=92 loses precision.  This error refers
>> to what seems to be a recurring theme throughout PowerLoom's C++ c
>> odebase.  Just wondering why the boolean cast is required.  Also,
>> wondering why its not compiling for me, when clearly this idiom mu
>> st have worked with gcc at some point.  I'm running 64bit Ubuntu L
>> inux 9.10 with g++ version 4.4.1.  Note that the code associated w
>> ith this specific error is:
>>
>>    if (!((boolean)(self))) {
>>          stream << "!NULL!";
>>    }
>
>
> Looking at this a bit more closely, what it turns out to be is an
> "optimization" in the generated C++ code to implement at  test for a
> null object.  Now, I'm not completely sure of all of the background,
> but I suspect that at one point there was a C compiler that
> complained about using a non-boolean in a boolean test, so a cast is
> used.  (Or it could be that the cast is just created because of the
> casting used in Stella to generate the optimization.
>
> Is this error actually stopping the generation of code, or is this
> more of a warning rather than a hard error?  I don't happen to have
> gcc 4.4 installed.  All I have is 4.0 and 4.2 right now.  G++ 4.0
> certainly doesn't complain about that construct at all.
>
>
>
>