Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to get rid of remarks of the intel compiler

Author: Robert Hyatt

Date: 15:28:56 01/08/03

Go up one level in this thread


On January 08, 2003 at 16:01:34, Dieter Buerssner wrote:

>On January 08, 2003 at 15:45:27, Robert Hyatt wrote:
>
>>On January 07, 2003 at 09:16:21, Uri Blass wrote:
>>
>>>2)I get a lot of remarks for movei and the most popular remark is
>>>
>>>external definition with no prior declaration
>>>
>>>Do I need to declare function before I use it.
>>
>>Yes you must.
>
>Hmmm - I don't see this. Can you cite a part of the C Standard, that shows, that
>you really "must"?

Yes.

The part that says "if a function is not declared before it is used, the
assumptions are
..."

:)

By the same token, You should always use signed or unsigned when declaring chars
since the standard leaves that an open issue as well...


>
>>>5)operands are evaluated in unspecified order
>>>
>>>It is not my fault that the intel compiler does not know that the order of
>>>adding is not important because it does not know that calculating one expression
>>>does not change the second expression.
>>>
>>>Uri
>>
>>The order _is_ specific.  That usually means you are mixing operators of
>>difference
>>precedence without using () to specify your chosen order of evaluation.  Just
>>add
>>the parens to avoid some _ugly_ errors...
>
>The order, in which different terms are evaluated in aritmetic expressions is
>typically _not_ specific in C. Mixing operators of _different_ precedence
>without () is no problem at all. Normally, one would not want to write
>
>w = ((x*y) + z);


Sure...  but what about the bitboard stuff that includes

a>>n+1

That can wreck a program silently and hideously...

Depending on what you mean...




>
>instead of
>
>w = x*y + z;
>
>which is guaranteed to mean the same thing in C.
>
>Regards,
>Dieter


You missed the point.  That means that someone _knows_ what is going on.  :)

IE w = z + x*y;

I know how that works. but a beginner might not.  And by using parens he avoids
a whole lot of problems.  For the bitwise operators and a lot of others I don't
even
try to remember which is done first, I just use parens.



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.