Commit 4c4c0724 authored by James Clark's avatar James Clark Committed by Namhyung Kim
Browse files

perf: Always feature test reallocarray



This is also used in util/comm.c now, so instead of selectively doing
the feature test, always do it. If it's ever used anywhere else it's
less likely to cause another build failure.

This doesn't remove the need to manually include libc_compat.h, and
missing that will still cause an error for glibc < 2.26. There isn't a
way to fix that without poisoning reallocarray like libbpf did, but that
has other downsides like making memory debugging tools less useful. So
for Perf keep it like this and we'll have to fix up any missed includes.

Fixes the following build error:

  util/comm.c:152:31: error: implicit declaration of function
                      'reallocarray' [-Wimplicit-function-declaration]
  152 |                         tmp = reallocarray(comm_strs->strs,
      |                               ^~~~~~~~~~~~

Fixes: 13ca6287 ("perf comm: Add reference count checking to 'struct comm_str'")
Reported-by: default avatarAli Utku Selen <ali.utku.selen@arm.com>
Signed-off-by: default avatarJames Clark <james.clark@linaro.org>
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250129154405.777533-1-james.clark@linaro.org


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 8ce0d2da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment