[Xcb] Git usage question

Barton C Massey bart at cs.pdx.edu
Mon Oct 6 14:03:33 PDT 2008


In message <200810051737.16611.doomster at knuut.de> you wrote:
> 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.

Oh, ok.  Thanks for the explanation!  Patch pushed.
    
    Bart


More information about the Xcb mailing list