Computer Chess Club Archives


Search

Terms

Messages

Subject: Maybe a MSVC 6 compiler bug with standard types conversion ?

Author: Daniel Mehrmannn

Date: 18:40:42 02/05/05


Hello,

from time to time i just compile my engine with "post all errors" flags.
I must do this with all compilers because the upcoming public Homer release will
support over 12 different OS platforms.

Under Windows i'm using MSVC 6 with SP6 und complier version:

Optimierender Microsoft (R) 32-Bit C/C++-Compiler, Version 12.00.8804, fuer x86

I only wanna ask here if its known that the MS compiler have maybe problems
with casting standard c types if we used this types as a pointer in the function
head ?

Example:
May we define a unsigend char in a function and give the adress to another
function.

#define SET_BIT_1 1
#define SET_BIT_2 2

void
DoSomeThingWith_i(unsigend char *i)
{
     *i = SET_BIT_1 | SET_BIT_2;

}

void
example()
{
     unsigned char i = 0;
     DoSomeThingWith_i(&i);
}

And here my complier give a cast waring out by line: *i = SET_BIT_1 | SET_BIT_2;

Allso my Intel compiler _don't_ give a waring here. GCC not tested.

daniel










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.