configure: warn about excessive stack usage

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 <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2026-02-28 03:45:20 +01:00
parent 3291afd30f
commit 6e322fa582

4
configure vendored
View File

@@ -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