[Bug libc/31749] New: endian.h should define uint16_t, uint32_t, and uint64_t
collin.funk1 at gmail dot com
sourceware-bugzilla@sourceware.org
Fri May 17 04:35:01 GMT 2024
https://sourceware.org/bugzilla/show_bug.cgi?id=31749
Bug ID: 31749
Summary: endian.h should define uint16_t, uint32_t, and
uint64_t
Product: glibc
Version: 2.39
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: collin.funk1 at gmail dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Hello,
Not sure if it is too soon to care about POSIX revision 8 since it isn't
official yet.
The next revision will likely require <endian.h> to define uint16_t, uint32_t,
or uint64_t. Optionally, it may make all symbols from <stdint.h> visible [1].
I was writing a Gnulib module using that specification and noticed that glibc
doesn't define those types. My system uses glibc 2.39.
Here is a snippet from the test case I was writing for Gnulib. Feel free to use
it if it is of any help:
$ cat main.c
#define _GNU_SOURCE 1
#include <endian.h>
static_assert (LITTLE_ENDIAN != BIG_ENDIAN);
static_assert (BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == BIG_ENDIAN);
uint16_t t1;
uint32_t t2;
uint64_t t3;
int
main (void)
{
return 0;
}
$ gcc -std=c23 main.c
main.c:8:1: error: unknown type name ‘uint16_t’
8 | uint16_t t1;
| ^~~~~~~~
main.c:4:1: note: ‘uint16_t’ is defined in header ‘<stdint.h>’; this is
probably fixable by adding ‘#include <stdint.h>’
3 | #include <endian.h>
+++ |+#include <stdint.h>
[...]
Thanks!
[1] https://austingroupbugs.net/view.php?id=162
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list