<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/include/nolibc/stdint.h, branch v6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-03-20T15:45:21Z</updated>
<entry>
<title>tools/nolibc: add integer types and integer limit macros</title>
<updated>2023-03-20T15:45:21Z</updated>
<author>
<name>Vincent Dagonneau</name>
<email>v@vda.io</email>
</author>
<published>2023-03-04T14:26:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e9fd4e9a1d5c054b6da6158632dca69d1d7aecc'/>
<id>urn:sha1:3e9fd4e9a1d5c054b6da6158632dca69d1d7aecc</id>
<content type='text'>
This commit adds some of the missing integer types to stdint.h and adds
limit macros (e.g. INTN_{MIN,MAX}).

The reference used for adding these types is
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html.

We rely on the compiler-defined __LONG_MAX__ to get the right limits for
size_t, intptr_t, uintptr_t and ptrdiff_t. This compiler constant seem
to have been defined at least since GCC 4.1.2 and clang
3.0.0 on x86_64. It is also defined on ARM (32&amp;64), mips and RISC-V.

Note that the maximum size of size_t is implementation-defined (&gt;65535),
in this case I chose to go with unsigned long on all platforms since
unsigned long == unsigned int on all the platforms we care about. Note
that the kernel uses either unsigned int or unsigned long in
linux/include/uapi/asm-generic/posix_types.h. These should be equivalent
for the plaforms we are targeting.

Also note that the 'fast*' flavor of the types have been chosen to be
always 1 byte for '*fast8*' and always long (a.k.a. intptr_t/uintptr_t) for
the other variants. I have never seen the 'fast*' types in use in the wild
but that seems to be what glibc does.

Signed-off-by: Vincent Dagonneau &lt;v@vda.io&gt;
Reviewed-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add stdint.h</title>
<updated>2023-03-20T15:45:21Z</updated>
<author>
<name>Vincent Dagonneau</name>
<email>v@vda.io</email>
</author>
<published>2023-03-04T14:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c34da317e0466815d7f43cbd81b3380a11a45b52'/>
<id>urn:sha1:c34da317e0466815d7f43cbd81b3380a11a45b52</id>
<content type='text'>
Nolibc works fine for small and limited program however most program
expect integer types to be defined in stdint.h rather than std.h.

This is a quick fix that moves the existing integer definitions in std.h
to stdint.h.

Signed-off-by: Vincent Dagonneau &lt;v@vda.io&gt;
Reviewed-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
