Bug 349851

Summary: %lld format used for long type in ls.c
Product: [Fedora] Fedora Reporter: Doug Chapman <dchapman>
Component: e2toolsAssignee: Hans Ulrich Niedermann <rhbugs>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: oliver
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: 0.0.16-9.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-15 17:44:24 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:
Bug Depends On:    
Bug Blocks: 163350    

Description Doug Chapman 2007-10-24 01:59:14 UTC
Description of problem:
The spec file has e2tools compiled with warnings treated as errors.  On ia64
(and likely other full 64 bit systems) this causes e2tools to fail to build at
ls.c line 660:

    660     printf("%7lld", info->inode.i_size |
    661            ((__u64)info->inode.i_size_high << 32));


There is probably a much better and more generic way to deal with this but we
need something like this:

#ifdef __ia64__
    printf("%7ld", info->inode.i_size |
           ((__u64)info->inode.i_size_high << 32));
#else
    printf("%7lld", info->inode.i_size |
           ((__u64)info->inode.i_size_high << 32));
#endif


Version-Release number of selected component (if applicable):
e2tools-0.0.16-5.fc7.src.rpm

How reproducible:
100%

Steps to Reproduce:
1. build on ia64
2.
3.
  
Actual results:
cc1: warnings being treated as errors
ls.c: In function 'long_disp':
ls.c:661: warning: format '%7lld' expects type 'long long int', but argument 2
has type 'long unsigned int'
make: *** [ls.o] Error 1


Expected results:


Additional info:

Comment 1 Hans Ulrich Niedermann 2007-12-08 21:28:21 UTC
*** Bug 416701 has been marked as a duplicate of this bug. ***

Comment 2 Hans Ulrich Niedermann 2007-12-08 22:31:53 UTC
I hope 0.0.16-8 will fix this issue on both ia64 and alpha.

It does fix in on ppc64 which failed before with the very same warning.


Comment 3 Hans Ulrich Niedermann 2007-12-09 02:54:33 UTC
0.0.16-8 is broken on x86_64, as it seems that

  __u64_t is a long unsigned int (64bit)
  uint64_t is a long long unsigned int (64bit)
  PRIu64 is "llu"
  printf("%" PRIu64, (__u64)1) thusly produces a warning

Casting the expression to (uint64_t) should fix the thing on all platforms, once
and for all (cf. 0.0.16-9).


Comment 4 Oliver Falk 2007-12-09 21:45:02 UTC
Typical WorksForMe(tm) (now) bug. :-)

Comment 5 Fedora Update System 2007-12-10 20:42:32 UTC
e2tools-0.0.16-9.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update e2tools'

Comment 6 Fedora Update System 2007-12-10 20:44:01 UTC
e2tools-0.0.16-9.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update e2tools'

Comment 7 Fedora Update System 2007-12-15 17:44:22 UTC
e2tools-0.0.16-9.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2007-12-15 17:50:55 UTC
e2tools-0.0.16-9.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Oliver Falk 2007-12-16 21:40:11 UTC
worksforme(tm)

Comment 10 Hans Ulrich Niedermann 2007-12-17 11:17:45 UTC
(In reply to comment #3)
> 0.0.16-8 is broken on x86_64, as it seems that
> 
>   __u64_t is a long unsigned int (64bit)
>   uint64_t is a long long unsigned int (64bit)

I'm just being told that is not quite accurate, so I am going to correct this
for the sake off accuracy.

x86_64 defines

   __u64    as "unsigned long long"
   uint64_t as "unsigned long long int"

>   PRIu64 is "llu"
>   printf("%" PRIu64, (__u64)1) thusly produces a warning

This, however, still applies.