[CRIU] [PATCH 11/23] groups.c test: fix for clang

Kir Kolyshkin kir at openvz.org
Tue Oct 11 18:46:49 PDT 2016


clang complains:
> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   groups.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o groups
> groups.c:22:9: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>         if (ng < 0) {
>             ~~ ^ ~

Declare ng as int.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 test/zdtm/static/groups.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/static/groups.c b/test/zdtm/static/groups.c
index 1aed8f5..f7548ea 100644
--- a/test/zdtm/static/groups.c
+++ b/test/zdtm/static/groups.c
@@ -14,7 +14,8 @@ const char *test_author	= "Pavel Emelianov <xemul at parallels.com>";
 
 int main(int argc, char **argv)
 {
-	unsigned int ng, *grp, *grp2, i, max;
+	int ng;
+	unsigned int *grp, *grp2, i, max;
 
 	test_init(argc, argv);
 
-- 
2.7.4



More information about the CRIU mailing list