Bug 859428

Summary: be64toh returns unsigned long long int regardless of word length
Product: [Fedora] Fedora Reporter: Matthew Booth <mbooth>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: fweimer, jakub, law, pfrankli, schwab, spoyarek
Target Milestone: ---Keywords: Regression, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 859427 Environment:
Last Closed: 2014-02-05 23:17:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 859427    
Bug Blocks:    

Description Matthew Booth 2012-09-21 14:15:29 UTC
+++ This bug was initially created as a clone of Bug #859427 +++

Description of problem:
I have some code something like this:

uint64_t be;
printf(PRIu64, be64toh(be));

This compiles on F17, but not on F18 and rawhide. The error is:

ldm.c:1079:5: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'long long unsigned int' [-Werror=format]

In F17, __bswap_64 is defined as:

# if __WORDSIZE == 64
#  define __bswap_64(x) \
     (__extension__                                                           \
      ({ register unsigned long __v, __x = (x);                               \
# else
#  define __bswap_64(x) \
     (__extension__                                                           \
      ({ union { __extension__ unsigned long long int __ll;                   \

However, on F18 and rawhide it becomes:

# if __GNUC_PREREQ (4, 2)
static __inline unsigned long long int
__bswap_64 (unsigned long long int __bsx)
  return __builtin_bswap64 (__bsx);
# elif __WORDSIZE == 64
<as above>

This means that on in F18 and rawhide, it returns unsigned long long int regardless of word length, which isn't the case on F17, causing my code to not compile.

Version-Release number of selected component (if applicable):

Comment 1 Jeff Law 2012-09-25 20:18:45 UTC
Unfortunately, you're going to need to fix your code as I don't see this changing.

By going to a uniform "unsigned long long" return value it makes it easier to generally avoid warnings in packages which are compiled for multiple architectures with varying wordsizes.

Comment 2 Siddhesh Poyarekar 2012-12-06 08:43:19 UTC
Reopening for backport.

Comment 3 Siddhesh Poyarekar 2012-12-06 08:48:25 UTC
I've pushed a build now, so the next bodhi push should have this fix.

Comment 4 Fedora Update System 2012-12-11 19:07:30 UTC
glibc-2.16-28.fc18 has been submitted as an update for Fedora 18.

Comment 5 Fedora Update System 2013-01-11 23:46:00 UTC
glibc-2.16-28.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Admin XMLRPC Client 2013-01-28 20:08:23 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora End Of Life 2013-12-21 15:41:34 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2014-02-05 23:17:12 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.