The patch titled Subject: mm: page_alloc: fix building error on -Werror=array-compare has been added to the -mm tree. Its filename is mm-page_alloc-fix-building-error-on-werror=array-compare.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-fix-building-error-on-werror%3Darray-compare.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-fix-building-error-on-werror%3Darray-compare.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Xiongwei Song <sxwjean@xxxxxxxxx> Subject: mm: page_alloc: fix building error on -Werror=array-compare Arthur Marsh reported we would hit the error below when building kernel with gcc-12: CC mm/page_alloc.o mm/page_alloc.c: In function `mem_init_print_info': mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare] 8173 | if (start <= pos && pos < end && size > adj) \ | In C++20, the comparision between arrays should be warned. Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@xxxxxx Signed-off-by: Xiongwei Song <sxwjean@xxxxxxxxx> Reported-by: Arthur Marsh <arthur.marsh@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page_alloc.c~mm-page_alloc-fix-building-error-on-werror=array-compare +++ a/mm/page_alloc.c @@ -8220,7 +8220,7 @@ void __init mem_init_print_info(void) */ #define adj_init_size(start, end, size, pos, adj) \ do { \ - if (start <= pos && pos < end && size > adj) \ + if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \ size -= adj; \ } while (0) _ Patches currently in -mm which might be from sxwjean@xxxxxxxxx are mm-page_alloc-fix-building-error-on-werror=array-compare.patch