Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79791 - net-print/cups-1.1.23 fails to build on amd64 and gcc-4-cvs because of a bad cast
Summary: net-print/cups-1.1.23 fails to build on amd64 and gcc-4-cvs because of a bad ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-27 17:14 UTC by Andreas Pokorny
Modified: 2005-04-30 02:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cups-gcc4.patch (cups.patch,566 bytes, patch)
2005-01-27 17:21 UTC, Andreas Pokorny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pokorny 2005-01-27 17:14:36 UTC
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
Comment 1 Andreas Pokorny 2005-01-27 17:21:41 UTC
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 :(
Comment 2 Danny van Dyk (RETIRED) gentoo-dev 2005-01-28 03:26:47 UTC
Hi Andreas, I'll relay this to the printing-herd.

Printing-Herd: Please review and apply this patch.
Comment 3 Jonathan Briggs 2005-02-15 22:52:21 UTC
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 :-)
Comment 4 Simon Stelling (RETIRED) gentoo-dev 2005-04-29 08:11:56 UTC
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
Comment 5 Heinrich Wendel (RETIRED) gentoo-dev 2005-04-29 08:16:13 UTC
no objections if this patch is correct, i don't have gcc-4 to test it
Comment 6 Simon Stelling (RETIRED) gentoo-dev 2005-04-30 02:15:01 UTC
fixed