From: Simon Glass <simon.glass@canonical.com> When CONFIG_MCHECK_HEAP_PROTECTION is enabled, dlmemalign_impl() calls dlmalloc_impl() directly since the mcheck wrapper handles alignment. This leaves internal_memalign() unused, causing a compiler warning. Guard internal_memalign() with a preprocessor check so it's only compiled when needed (mcheck disabled or MSPACES enabled). Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- common/dlmalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/dlmalloc.c b/common/dlmalloc.c index b46be1899f0..efeff18653f 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -5309,6 +5309,7 @@ static mchunkptr try_realloc_chunk(mstate m, mchunkptr p, size_t nb, } #endif /* !defined(__UBOOT__) || !NO_REALLOC_IN_PLACE */ +#if !CONFIG_IS_ENABLED(MCHECK_HEAP_PROTECTION) || MSPACES static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { void* mem = 0; if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ @@ -5422,6 +5423,7 @@ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { } return mem; } +#endif /* !CONFIG_MCHECK_HEAP_PROTECTION || MSPACES */ /* Common support for independent_X routines, handling -- 2.43.0