Bug 859428 - be64toh returns unsigned long long int regardless of word length
be64toh returns unsigned long long int regardless of word length
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Carlos O'Donell
Fedora Extras Quality Assurance
: Regression, Reopened
Depends On: 859427
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-21 10:15 EDT by Matthew Booth
Modified: 2016-11-24 07:45 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 859427
Environment:
Last Closed: 2014-02-05 18:17:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2012-09-21 10:15:29 EDT
+++ 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);                               \
<snip>
# else
#  define __bswap_64(x) \
     (__extension__                                                           \
      ({ union { __extension__ unsigned long long int __ll;                   \
<snip>

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):
glibc-headers-2.16.90-11.fc19.x86_64.rpm
Comment 1 Jeff Law 2012-09-25 16:18:45 EDT
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 03:43:19 EST
Reopening for backport.
Comment 3 Siddhesh Poyarekar 2012-12-06 03:48:25 EST
I've pushed a build now, so the next bodhi push should have this fix.
Comment 4 Fedora Update System 2012-12-11 14:07:30 EST
glibc-2.16-28.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/glibc-2.16-28.fc18
Comment 5 Fedora Update System 2013-01-11 18:46:00 EST
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 15:08:23 EST
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 10:41:34 EST
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 18:17:12 EST
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
bug.

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

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