[Xcb] Git usage question

Ulrich Eckhardt doomster at knuut.de
Sun Oct 5 08:37:16 PDT 2008


On Sunday 05 October 2008 01:28:04 Barton C Massey wrote:
> As to the patch content, I think it depends. :-)  The casts
> that you are removing are mostly from habit, but they are
> AFAIK harmless, and are required for some pre-ANSI C
> compilers.  I'd probably just leave them alone, were it me.
> Is there something I'm missing?  What do others think?

Actually, iff it were for compatibility, the whole XCB sources wouldn't 
compile. The three cases were the only three in the code with casts, with 
several more invocations of malloc(). Now, since XCB probably won't compile 
with >10years old compilers, this leaves the danger of these casts. If you 
happen to forget to include stdlib.h (or whichever header declares malloc()), 
the compiler will happily assume an 'int malloc()' prototype. The cast will 
then silence the warning about the conversion from int to pointer and the 
whole will cause failures at runtime when an int has a different size than a 
pointer, i.e. on 64 bit platforms.

About the other stuff concerning git usage, maybe later more. I'm dead tired, 
being out all day in the rain. ;)

cheers!

Uli


More information about the Xcb mailing list