Bug 80825 - source code won't work on 64 bit boxes
source code won't work on 64 bit boxes
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: textutils (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-31 13:16 EST by d.binderman
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-06 08:00:45 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)

  None (edit)
Description d.binderman 2002-12-31 13:16:07 EST
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 08:00:45 EST
Please take a look at coreutils in rawhide.  It has several fixes like this.
Comment 2 d.binderman 2003-01-06 14:57:24 EST
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 15:03:35 EST
ftp.redhat.com:/pub/rawhide

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