mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

There's some expressed interest in having the compiler flag -Wconversion detect at build time certain kinds of potential problems: https://lore.kernel.org/lkml/20250103182532.GB781381@e132581.arm.com/ As feature detection passes -Wconversion from CFLAGS when set, the feature detection compile tests need to not fail because of -Wconversion as the failure will be interpretted as a missing feature. Switch various types to avoid the -Wconversion issue, the exact meaning of the code is unimportant as it is typically looking for header file definitions. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: James Clark <james.clark@linaro.org> Link: https://lore.kernel.org/r/20250106215443.198633-1-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
20 lines
363 B
C
20 lines
363 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <stdlib.h>
|
|
|
|
#if !defined(__UCLIBC__)
|
|
#include <gnu/libc-version.h>
|
|
#else
|
|
#define XSTR(s) STR(s)
|
|
#define STR(s) #s
|
|
#endif
|
|
|
|
int main(void)
|
|
{
|
|
#if !defined(__UCLIBC__)
|
|
const char *version = gnu_get_libc_version();
|
|
#else
|
|
const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
|
|
#endif
|
|
|
|
return version == NULL;
|
|
}
|