On Jul 17, 2012, at 1:04 AM, Fredrik Unger <f...@tree.se> wrote:

> One problem could be socklen_t. Linux uses size_t [1].
> (yes I read the comment in the code "To forestall portability problems")
> (I do not know Mac:s structs, also 32 bit probably size_t and socklen_t are 4 
> )
> I have not enough Python/C interface knowledge to know what dragons
> are hidden there..
> 
> For example the cast :
> message_header.msg_controllen = (socklen_t) all_data_len;
> 
> puts an int in the msg.controllen but an long long is expected?
> That cast might not be as bad as setting some length using &.

The compiler should know, at this point in the code, that msg_controllen is a 
size_t, which is to say, uint64, and ((socklen_t) all_data_len) is a socklen_t, 
which is to say, int32.  So the cast is valid.  (Doing funky stuff with & might 
not be, depending on the type specifiers in question.)  So this should never be 
a problem unless the length is negative.  Which, as far as I can tell, is 
impossible.

It took me a little while to verify that this is the case - type mismatches in 
C always worry me - but I am fairly certain this isn't our problem.

-glyph
_______________________________________________
calendarserver-users mailing list
calendarserver-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo/calendarserver-users

Reply via email to