From 6e322fa58263d61a5517182010405c09656673af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 28 Feb 2026 03:45:20 +0100 Subject: [PATCH] configure: warn about excessive stack usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a 120 KiB per-function threshold. This roughly matches the default thread stack size on Musl, which is 128 KiB, leaving some headroom for caller frames. This warning draws attention to functions in the codebase that may have excessively large stack frames. A few functions could benefit from reducing their frame size. 120 KiB is a reasonable limit. If a function requires more stack, it likely would benefit from restructuring the code. Signed-off-by: Kacper Michajłow --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index 1bfc08bc69..1759694274 100755 --- a/configure +++ b/configure @@ -7877,6 +7877,10 @@ check_warning -Wwrite-strings check_warning -Wtype-limits check_warning -Wundef check_warning -Wempty-body +# Warn about excessive stack usage, using a 120 KiB per-function threshold. +# This roughly matches the default thread stack size on Musl, which is 128 KiB, +# leaving some headroom for caller frames. +check_warning -Wstack-usage=122880 check_c_warning -Wmissing-prototypes check_c_warning -Wstrict-prototypes check_c_warning -Wunterminated-string-initialization