Thread: 050DR3 compile
View Single Post
  #10  
Old 10-02-2003, 07:12 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

As a side project for some of you up and coming developers, can you look into these..


Client::FinishConnState2(DBAsyncWork*)':
client_process.cpp:5136: warning: assignment of negative value `-1' to `int16'
client_process.cpp:5136: warning: argument of negative value `-1' to `short
unsigned int'
client_process.cpp:5140: warning: comparison between signed and unsigned
integer expressions
client_process.cpp:5149: warning: assignment of negative value `-1' to `int16'
client_process.cpp:5149: warning: argument of negative value `-1' to `short
unsigned int'
client_process.cpp:5151: warning: assignment of negative value `-1' to `int32'
client_process.cpp:5151: warning: argument of negative value `-1' to `unsigned
int'



This worries me, when you jam a -1 into a nonnegative type, you end up with really weird outcomes... 4012331212312..... I've mentioned it to Merth, but neither one of us has really had the time to look at it. I started to try and fix the casts, just havent been able to follow through.

Im guessing this is because the first binary bit in an unsigned is one to indicate a negative number, so when its cast to a positive,its intrepreted incorrectly and becomes something abnormally large..

1001 would be -1 in signed, 9 unsigned for instance...

client_process and parser.cpp both have a slew of these warnings, anyone want to take a stab at discovering what the outcome is ?
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote