Bug 103492

Summary: top from procps in rawhide isn't portable to Windows XP 64bit edition
Product: [Retired] Red Hat Raw Hide Reporter: Mike A. Harris <mharris>
Component: procpsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.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: 2004-03-29 12:47:13 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 Mike A. Harris 2003-09-01 06:53:26 UTC
Putting this in bugzilla at Alex's request:

When compiling rawhide procps-2.0.13-8 on AMD64, and presumeably other
64bit architectures, the following compiler warnings are spit out.


gcc -O2 -g -pipe -D_GNU_SOURCE -O2 -Wall -Wstrict-prototypes -Wshadow
-I/usr/src/build/299867-x86_64/BUILD/procps-2.0.13 -I/usr/include/ncurses
-fwritable-strings -c top.c
top.c: In function `do_stats':
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 2)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 4)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 5)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 7)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 8)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 10)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 11)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 13)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 14)
top.c:1699: warning: long long unsigned int format, long unsigned int arg (arg 16)

I'm not sure if this is in the stock source code or if it is due to a patch
we're applying, never checked.  On the majority of 64bit systems out there,
"long" and "long long" are both 64bit, so this probably won't cause any
problems on architectures we support currently.  I dunno if long is 32bit
or 64 bit on sparc or other platforms, but we don't support them anyway.

long is however 32bit on Win64, so top won't be portable to Windows XP 64bit
edition unless this bug is fixed.  ;o)

Comment 1 Arjan van de Ven 2003-09-01 06:55:23 UTC
on amd64 long long is 128 bits iirc

Comment 2 Mike A. Harris 2003-09-01 07:25:20 UTC
pts/0 mharris@thor:~$ uname -a
Linux thor.perf.redhat.com 2.4.21-1.1931.2.393.entsmp #1 SMP Wed Aug 13 21:26:37
EDT 2003 x86_64 x86_64 x86_64 GNU/Linux
pts/0 mharris@thor:~$ cat src/types.c
#include <stdio.h>
int main(void)
{
        printf("sizeof(char)=%d\n", sizeof(char));
        printf("sizeof(short)=%d\n", sizeof(short));
        printf("sizeof(int)=%d\n", sizeof(int));
        printf("sizeof(long)=%d\n", sizeof(long));
        printf("sizeof(long long)=%d\n", sizeof(long long));
        return 0;
}
pts/0 mharris@thor:~$ types
sizeof(char)=1
sizeof(short)=2
sizeof(int)=4
sizeof(long)=8
sizeof(long long)=8


Comment 3 Daniel Walsh 2004-03-25 15:41:23 UTC
We have upgraded to procps-3.1.15  Is that better?

Comment 4 Daniel Walsh 2004-03-29 12:47:13 UTC
Comments from upstream:


The top.c code was completely replaced. You should expect
numerous warnings though; I enable nearly everything I can.
On my system gcc's own headers produce warnings.