Bug 176894

Summary: htdig fails to build in rawhide
Product: [Fedora] Fedora Reporter: Jesse Keating <jkeating>
Component: htdigAssignee: Radek Vokál <rvokal>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dcantrell, grdetil
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 18:07:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 176952    
Attachments:
Description Flags
build failure log
none
patch to supress warning/error message about left shift count >= width of type none

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.