This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/16458] endian.h macros return integers of wrong type


https://sourceware.org/bugzilla/show_bug.cgi?id=16458

--- Comment #6 from Jaak Ristioja <jaak at ristioja dot ee> ---
(In reply to joseph@codesourcery.com from comment #5)
> On Thu, 16 Jan 2014, jaak at ristioja dot ee wrote:
> 
> > If you insist these being macros, at least the documentation should be fixed
> > accordingly. Reopening.
> 
> "The documentation" for glibc is the Texinfo manual; manpages are an 
> independent project not covered by this tracker or the glibc maintainers.

It appears that these interfaces are undocumented in the Texinfo manual.

Why not just add simple casts to these macros? For example, instead of

  #   define htobe64(x) __bswap_64 (x)
  #   define htole64(x) (x)

use

  #   define htobe64(x) __bswap_64 ((uint64_t)(x))
  #   define htole64(x) ((uint64_t)(x))

PS: At first sight the htonl, htons, ntohl and ntohs macros in <netinet/in.h>
also appear to require similar casts.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]