futility/host: fix builds against newer glibc
glibc 2.43 started enforcing C23/C++ rules for strchr and strrchr,
so they return a const char * if the input is const char *, which
fails due to -Wincompatible-pointer-types-discards-qualifiers.
In normal_fmap() we need to write into the strings (replacing the
':' separator with '\\0'), so they are not really const.
The sole caller passes argv straight through, so just drop the inner
const from the names parameter rather than casting it away locally.
The host_key2 fix is trivial: just add const to the declaration.
BRANCH=main
BUG=b:491765858
TEST=Local builds on amd64-generic and arm64-generic with glibc 2.43.
Change-Id: I284fc8fd35abb4974560fcb230ac1b3187b2043b
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/7792932
Tested-by: Adrian Ratiu <adrian.ratiu@collabora.corp-partner.google.com>
Reviewed-by: Bob Haarman <inglorion@chromium.org>
Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Adrian Ratiu <adrian.ratiu@collabora.corp-partner.google.com>
2 files changed