tst_minmax.h: Include <sys/param.h>
PATCH 1/1 tst_minmax.h: Include <sys/param.h>
It's always good to first include header which defines macros/structures before define fallback. In this case it's needed to avoid redefinition:
$ make check-hugemmap15 CHECK testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c hugemmap15.c: note: in included file: /usr/include/sys/param.h:102:9: warning: preprocessor token MIN redefined hugemmap15.c: note: in included file (through ../../../../../include/tst_test.h, testcases/kernel/mem/hugetlb/hugemmap/../lib/hugetlb.h): ../../../../../include/tst_minmax.h:9:10: this was the original definition hugemmap15.c: note: in included file: /usr/include/sys/param.h:103:9: warning: preprocessor token MAX redefined hugemmap15.c: note: in included file (through ../../../../../include/tst_test.h, testcases/kernel/mem/hugetlb/hugemmap/../lib/hugetlb.h): ../../../../../include/tst_minmax.h:18:10: this was the original definition
Redefinitions is done because hugemmap15.c needs tst_test.h for TST_TEST_TCONF(), but <sys/param.h> which defines MIN/MAX() is later included.
Signed-off-by Petr Vorel <[email protected]>
---
Hi,
another trivial fix, which can wait till the release.
Kind regards,
Petr
include/tst_minmax.h | 3 +++ 1 file changed, 3 insertions(+)
include/tst_minmax.h +3 -0
@@ -1,10 +1,13 @@/* SPDX-License-Identifier: GPL-2.0-or-later * Copyright (c) 2017 Cyril Hrubis <[email protected]> +* Copyright (c) Linux Test Project, 2020-2023 */ #ifndef TST_MINMAX_H__ #define TST_MINMAX_H__ +#include <sys/param.h> +#ifndef MIN # define MIN (a, b) ({ \ typeof(a) _a = (a); \
Signature · 5 lines
2.39.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi,
FYI merged.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp