Bug 80825 - source code won't work on 64 bit boxes
Summary: source code won't work on 64 bit boxes
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils
Version: 8.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
Depends On:
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:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-06 13:00:45 UTC

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:

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

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

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