required hack for Xeon 64



Hi again.

I just wanted to share some modifications to the core-8.4-branch code I had
to make in order to avoid the following message :

---------------------------

Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss
of data. If this was intentional, you should mask the source of the cast
with the appropriate bitmask. For example:

char c = (i & 0xFF);

Changing the code in this way will not affect the quality of the resulting
optimized code.

----------------------------

This concerns MSVC 8.0 and Windows xp64 (MACHINE=0x64). The changes are, as
suggested above, to perform a 0xFF on various ints in tclCompile.h. :

#define TclStoreInt4AtPtr(i, p) \

*(p) = (unsigned char) (0xFF & ((unsigned int) (i) >> 24)); \

*(p+1) = (unsigned char) (0xFF & ((unsigned int) (i) >> 16)); \

*(p+2) = (unsigned char) (0xFF & ((unsigned int) (i) >> 8)); \

*(p+3) = (unsigned char) (0xFF & ((unsigned int) (i)))



the same goes for TclEmitInstInt4.

Perhaps this would be an issue for 8.5 as well.



Regards,

Anders.

I c


.



Relevant Pages

  • Re: mySqlBytes.buffer is getting converted to BigEndian even though both SQL server 2005 and the CLR
    ... The behavior the OP claims to observe is that the cast, not BitConverter, is ... convert a data type from its original data type and back again, ... It is the BitConverter class that 'knows' to return the bytes for an int ... server 2005 and the CLR function are on the same machine which shows ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Passing Timestamp value to sql server
    ... the following example cast the timestamp to a data type of datetime: ... You can also cast it to another type. ... >I still need to pass the value back to the server. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: CAST error during FETCH in SQLRPGLE program
    ... C+ LEFT OUTER JOIN ALLOCCAN B ... A character in the argument for the CAST function was not correct. ... Change the result data type to one that recognizes the characters in the CAST argument, or change the argument to contain a valid representation of a value for the result data type. ...
    (comp.sys.ibm.as400.misc)
  • Re: ? Run-Time Check Failure #1 with Built-In RGB Functions
    ... COLORREF variable to a BYTE throws the following ... Run-Time Check Failure #1 - A cast to a smaller data type has ... Copyright Microsoft Corporation. ...
    (microsoft.public.vc.language)
  • Re: Why are there no covariant return types?
    ... Stoitcho Goutsev [C# MVP] ... > Stoitcho Goutsev wrote: ... you should avoid any cast if possible because every cast is a ... > class you are dealing with *and* you can avoid any cast. ...
    (microsoft.public.dotnet.languages.csharp)