Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: minimize warnings in Compiling Crafty on different kind of platforms

Author: Robert Hyatt

Date: 14:16:18 10/24/99

Go up one level in this thread


On October 23, 1999 at 16:01:32, Michel Langeveld wrote:

>When compiling Crafty on different platforms with different compilers, compilers
>will puge different types warnings. I would like to see some couple of persons
>spent some time in cleaning up the code to minimize the number of warnings
>without making the code more difficult to understand.
>
>What do you think about this idea?
>
>Bob, I remember Dann Corbit explained a few weeks ago what was different of your
>Crafty version and "his" crafty version. Did you changed things to minimize the
>delta's between you and his?
>
>kind regards,
>
>Michel Langeveld


This is basically impossible.  Some compilers don't like this:

long long a;
long b;

a=anything;
b=a;

they complain about losing precision.

So I fix it:

a=anything;
b=(long)a;

HP's compiler now complains about losing precision.

Some compilers also can't build a proper dependency graph and think that
if (a)  val=0;
else if (b)  val=1;
else val=2;

...

x+=val;

is using a variable that might not be initialized before it is used (val).
It is wrong.  There is no path thru that that doesn't initialize val before
it is used.

It is basically impossible to write a piece of code that is 100% warning-free
on all compilers.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.