Bug 176894 - htdig fails to build in rawhide
Summary: htdig fails to build in rawhide
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: htdig
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: mbt3blocker
TreeView+ depends on / blocked
 
Reported: 2006-01-04 02:10 UTC by Jesse Keating
Modified: 2013-01-10 21:50 UTC (History)
2 users (show)

Fixed In Version: 3:3.2.0b6-6.4.2
Clone Of:
Environment:
Last Closed: 2006-02-09 18:07:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
build failure log (297.88 KB, text/plain)
2006-01-04 02:10 UTC, Jesse Keating
no flags Details
patch to supress warning/error message about left shift count >= width of type (1.19 KB, patch)
2013-01-10 21:31 UTC, Gilles Detillieux
no flags Details | Diff

Description Jesse Keating 2006-01-04 02:10:17 UTC
Please see attached log.  Build fails on x86_64

Comment 1 Jesse Keating 2006-01-04 02:10:17 UTC
Created attachment 122748 [details]
build failure log

Comment 2 Gilles Detillieux 2008-02-27 19:38:14 UTC
I can't test this right now, but I suspect the line that's causing the error in
Display.cc is this one (line 1230 after patches applied):

    time_t eternity = ~(1<<(sizeof(time_t)*8-1));  // will be the largest value
holdable by a time_t

On 32-bit systems, the "1" that gets shifted is a 32-bit int, and time_t is a
32-bit "long int".  But on 64-bit systems, the 1 is still 32 bits, while time_t
is a 64-bit long int.  The fix would probably be to replace the "1" before the
"<<" with "((time_t)1)".  Please give that a try and see if it fixes the error.

Comment 4 Gilles Detillieux 2013-01-10 21:31:32 UTC
Created attachment 676555 [details]
patch to supress warning/error message about left shift count >= width of type

I was surprised to see there was still activity on this bug report. Yesterday a CC was added, so I'm assuming there's still an issue building on some 64-bit systems.  The only 64 bit Linux system I have is Scientific Linux 6.3 (an RHEL 6.3 clone).  There I get a warning, not an error, but it's the same expression in the code causing the problem.  A well placed type cast clears up that warning.  This patch hits the two files where that expression appears.

Comment 5 Gilles Detillieux 2013-01-10 21:50:10 UTC
Looking at the build failure log more closely, I see I misread it the last couple times.  The message about the left shift was a warning in this log too, not an error.  I just zeroed in on the last message, rather than looking for the last actual error message.  I see that the error was fixed by htdig-3.2.0b6-compile-fix.patch some time ago.  In any case, the type casts in my patch above are still a good idea because on some 64 bit architectures you could end up with a very wrong value for "eternity" (e.g. -1) if the shift is done on a 32-bit int rather than a 64-bit one, when the target type is supposed to be 64 bits.


Note You need to log in before you can comment on or make changes to this bug.