[Devel] 64-bit compatability

Eliot Gable egable at broadvox.net
Thu Dec 21 20:04:00 CET 2006


Throughout a lot of the code, I have found many instances where memory
locations are being cast to unsigned int or unsigned long (and even
sometimes just int) instead of size_t. This can cause a problem on
64-bit systems due to memory addresses being 64-bit as opposed to 32-bit
like unsigned int or int. If you use size_t, it correctly uses 64-bit on
64-bit systems and 32-bit on 32-bit systems. But that means that in
str.h, the len parameter must be size_t instead of int to prevent
warnings about signedness. 

Also, is there any reason the code is not being compiled globally with 
-Wall? It catches a lot of these issues for you.

Eliot Gable
Operations Engineer
CCNA, CWNA, CWSP, Network+, Security+
Broadvox, LLC
1228 Euclid Avenue
Suite 390
Cleveland, OH 44115-1800
216-373-4808
 




More information about the Devel mailing list