Bug 80825 - source code won't work on 64 bit boxes
Summary: source code won't work on 64 bit boxes
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-31 18:16 UTC by d.binderman
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-01-06 13:00:45 UTC
Embargoed:


Attachments (Terms of Use)

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


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