[Live-devel] 64 bit portability
Ross Finlayson
finlayson at live555.com
Wed Dec 9 14:36:01 PST 2009
>- Are there any plans to get rid of there warnings to make Visual
>Studio compilers happy?
No, because most of those warnings are silly and/or bogus, and the
few warnings that *are* legitimate turn out not to be a problem in
our code.
Specifically:
- The "conversion from 'SOCKET' to int" warnings are bogus, because
the functions "socket()", "fcntl()", and "accept()" have always
returned "int" - so if Windoze now thinks that they should return
some other data type, then it's just plain broken, IMHO.
- The "conversion from 'size_t'" warnings are a bit silly, because
functions like "strnlen()" etc. can never reasonably be expected to
return sizes >= 2^32 (our buffers will never be that large).
- The "conversion to pointer types of 'greater size'" warnings are
silly, because these can never cause errors. In our code, these
warnings happen only because we use "char*" (i.e., a pointer type) as
the type of keys in our hash tables, but the actual keys that we use
in some hash table instances will often be other data types (e.g.,
unsigned) that might (on a 64-bit machine) be smaller (but never
larger).
- The "pointer truncation" warnings are legitimate, but in our code
they're OK, because (in all but one[*] case) they occur only when we
retrieve a key from a hash table, and we know for sure that the
actual key type is some type other than a pointer.
[*] The one other place where we do a 'pointer truncation' is when we
use a pointer value to generate a random hash table index. In this
case it's OK to use the lower 32 bits only.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list