On Mon, 29 Jun 2026 10:21:24 +0800 Yichong Chen <[email protected]>
wrote:
> tools/include/linux/overflow.h uses SIZE_MAX in its size helper
> functions.
>
> Include stdint.h so tools users that include overflow.h without another
> SIZE_MAX provider can build.
On the latest mm-new reverting this patch (for test), I was able to build
tools/virtio.
git checkout akpm.korg.mm/mm-new
[...]
HEAD is now at f5ea2fbe68e0c mm/swap, PM: hibernate: atomically replace
hibernation pin
$ git revert 9d462d8b9b705548451325ee4376dfd549e14aa2 -s --no-edit
[detached HEAD f2202247e38d9] Revert "tools/include: include stdint.h for
SIZE_MAX in overflow.h"
Date: Wed Jul 1 06:33:03 2026 -0700
1 file changed, 1 deletion(-)
$ make -C tools/virtio/ clean
make: Entering directory '/home/lkhack/worktree.linux/tools/virtio'
rm -f *.o vringh_test virtio_test vhost_net_test vhost_test/*.o \
vhost_test/.*.cmd vhost_test/Module.symvers \
vhost_test/modules.order *.d
make: Leaving directory '/home/lkhack/worktree.linux/tools/virtio'
$ make -C tools/virtio/ test
make: Entering directory '/home/lkhack/worktree.linux/tools/virtio'
cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I
../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing
-fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
-pthread -c -o virtio_test.o virtio_test.c
cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I
../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing
-fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
-pthread -c -o virtio_ring.o ../../drivers/virtio/virtio_ring.c
cc -pthread virtio_test.o virtio_ring.o -o virtio_test
cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I
../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing
-fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
-pthread -c -o vringh_test.o vringh_test.c
cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I
../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing
-fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
-pthread -c -o vringh.o ../../drivers/vhost/vringh.c
cc -pthread vringh_test.o vringh.o virtio_ring.o -o vringh_test
cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I
../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing
-fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
-pthread -c -o vhost_net_test.o vhost_net_test.c
cc -pthread vhost_net_test.o virtio_ring.o -o vhost_net_test
make: Leaving directory '/home/lkhack/worktree.linux/tools/virtio'
Am I missing something?
>
> Signed-off-by: Yichong Chen <[email protected]>
> ---
> tools/include/linux/overflow.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/include/linux/overflow.h b/tools/include/linux/overflow.h
> index 3427d7880326..98963688143f 100644
> --- a/tools/include/linux/overflow.h
> +++ b/tools/include/linux/overflow.h
> @@ -1,4 +1,5 @@
> /* SPDX-License-Identifier: GPL-2.0 OR MIT */
> +#include <stdint.h>
> #ifndef __LINUX_OVERFLOW_H
> #define __LINUX_OVERFLOW_H
Shouldn't the include placed after #define __LINUX_OVERFLOW_H ?
Thanks,
SJ
[...]