[Bug 1016349] [NEW] htons() returns wrong type on non-{i386, amd64} platforms

Anders Kaseorg andersk at mit.edu
Fri Jun 22 02:43:12 UTC 2012


Public bug reported:

The definition of htons() on platforms other than i386 and amd64 is
missing a cast to uint16_t, which caused this FTBFS of mosh on armel and
armhf:

https://launchpad.net/ubuntu/+source/mosh/1.2.1-1ubuntu1/+build/3582950
network.cc:76:28: error: narrowing conversion of '({...})' from 'unsigned int' to 'uint16_t {aka short unsigned int}' inside { } is ill-formed in C++11 [-Werror=narrowing]
network.cc:76:50: error: narrowing conversion of '({...})' from 'unsigned int' to 'uint16_t {aka short unsigned int}' inside { } is ill-formed in C++11 [-Werror=narrowing]

(We didn’t see this before because this warning is new in GCC 4.7.)

This was fixed for glibc 2.16 in
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2174c6dd8555f654c30df2f8f3321b69e0f736f8

** Affects: eglibc
     Importance: Unknown
         Status: Unknown

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: Confirmed

** Affects: glibc (Fedora)
     Importance: Unknown
         Status: Unknown

** Bug watch added: Sourceware.org Bugzilla #12194
   http://sourceware.org/bugzilla/show_bug.cgi?id=12194

** Also affects: eglibc via
   http://sourceware.org/bugzilla/show_bug.cgi?id=12194
   Importance: Unknown
       Status: Unknown

** Bug watch added: Red Hat Bugzilla #834447
   https://bugzilla.redhat.com/show_bug.cgi?id=834447

** Also affects: glibc (Fedora) via
   https://bugzilla.redhat.com/show_bug.cgi?id=834447
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1016349

Title:
  htons() returns wrong type on non-{i386,amd64} platforms

Status in Embedded GLIBC:
  Unknown
Status in “eglibc” package in Ubuntu:
  Confirmed
Status in “glibc” package in Fedora:
  Unknown

Bug description:
  The definition of htons() on platforms other than i386 and amd64 is
  missing a cast to uint16_t, which caused this FTBFS of mosh on armel
  and armhf:

  https://launchpad.net/ubuntu/+source/mosh/1.2.1-1ubuntu1/+build/3582950
  network.cc:76:28: error: narrowing conversion of '({...})' from 'unsigned int' to 'uint16_t {aka short unsigned int}' inside { } is ill-formed in C++11 [-Werror=narrowing]
  network.cc:76:50: error: narrowing conversion of '({...})' from 'unsigned int' to 'uint16_t {aka short unsigned int}' inside { } is ill-formed in C++11 [-Werror=narrowing]

  (We didn’t see this before because this warning is new in GCC 4.7.)

  This was fixed for glibc 2.16 in
  http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2174c6dd8555f654c30df2f8f3321b69e0f736f8

To manage notifications about this bug go to:
https://bugs.launchpad.net/eglibc/+bug/1016349/+subscriptions




More information about the foundations-bugs mailing list