This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/16458] endian.h macros return integers of wrong type
- From: "jaak at ristioja dot ee" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 16 Jan 2014 19:47:35 +0000
- Subject: [Bug libc/16458] endian.h macros return integers of wrong type
- Auto-submitted: auto-generated
- References: <bug-16458-131 at http dot sourceware dot org/bugzilla/>
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.