Bug 80825

Summary: source code won't work on 64 bit boxes
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: textutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-06 13:00:45 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:

Description d.binderman 2002-12-31 18:16:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I have just tried to compile package textutils-2.0.21-5 from Redhat 8.0

Here are some of the messages the compiler produces

cc: Warning: physmem.c, line 38: In the initializer for max, the shift count "60" is negative or is greater than or equal to the promoted size of the 
operand "1". (shiftcount)

Bit tricky to shift a 32 quantity by 60 bits.

Here is an untested patch to shut up the compiler.

./lib/physmem.c.old ./lib/physmem.c
*** ./lib/physmem.c.old	Fri Dec 27 14:21:19 2002
--- ./lib/physmem.c	Fri Dec 27 14:21:33 2002
***************
*** 35,41 ****
  static double
  physmem_cap (double mem)
  {
!   double max = 1 << (sizeof(void *)*8 - 4);
    return mem > max ? max : mem;
  }
  
--- 35,41 ----
  static double
  physmem_cap (double mem)
  {
!   double max = 1UL << (sizeof(void *)*8 - 4);
    return mem > max ? max : mem;
  }
  


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Compile on any 64 bit machine that has a C compiler that sanity checks shift counts,
for example Compaq.
2.
3.
    

Additional info:

Comment 1 Tim Waugh 2003-01-06 13:00:45 UTC
Please take a look at coreutils in rawhide.  It has several fixes like this.

Comment 2 d.binderman 2003-01-06 19:57:24 UTC
I would look at rawhide if I knew where it was.
I seem to have missed part of your message.

I'm only on the end of a 56K line, so it's unlikely I'll
be downloading anything as large as CD images anytime soon.

Comment 3 Tim Waugh 2003-01-06 20:03:35 UTC
ftp.redhat.com:/pub/rawhide