Bug 176894 - htdig fails to build in rawhide
htdig fails to build in rawhide
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: htdig (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks: mbt3blocker
  Show dependency treegraph
 
Reported: 2006-01-03 21:10 EST by Jesse Keating
Modified: 2013-01-10 16:50 EST (History)
2 users (show)

See Also:
Fixed In Version: 3:3.2.0b6-6.4.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-09 13:07:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
build failure log (297.88 KB, text/plain)
2006-01-03 21:10 EST, 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 16:31 EST, Gilles Detillieux
no flags Details | Diff

  None (edit)
Description Jesse Keating 2006-01-03 21:10:17 EST
Please see attached log.  Build fails on x86_64
Comment 1 Jesse Keating 2006-01-03 21:10:17 EST
Created attachment 122748 [details]
build failure log
Comment 2 Gilles Detillieux 2008-02-27 14:38:14 EST
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 16:31:32 EST
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 16:50:10 EST
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.