There is an ugly pointer to int cast in the cups source code. on gcc-3.4.0 only that happens: Compiling GfxFont.cxx... GfxFont.cxx: In member function `Gushort* Gfx8BitFont::getCodeToGIDMap(TrueTypeFontFile*)': GfxFont.cxx:972: warning: cast from pointer to integer of different size gcc-4 changed that behaviour, and now punishes abuse of c-pointer-casts with error messages, so this package now fails to build. Reproducible: Always Steps to Reproduce: 1. emerge cups Actual Results: Compiling GfxFont.cxx... GfxFont.cxx: In member function 'Gushort* Gfx8BitFont::getCodeToGIDMap(TrueTypeFontFile*)': GfxFont.cxx:972: error: cast from 'void*' to 'int' loses precision make[1]: *** [GfxFont.o] Error 1 make: *** [all] Error 1
Created attachment 49707 [details, diff] cups-gcc4.patch This turns that bad cast in another form of bad cast .. It is still terrible code. This makes it just compile, like before :(
Hi Andreas, I'll relay this to the printing-herd. Printing-Herd: Please review and apply this patch.
I think that your patch should case to ptrint_t instead of long. That way the integer will always be guaranteed to hold the whole thing. That's important for when 128-bit becomes common :-)
what is the state on this? did anybody test it already? printing-herd: if you don't have any objections, i'll commit it in the next days
no objections if this patch is correct, i don't have gcc-4 to test it
fixed