[CRIU] [PATCH 14/23] cmdlinenv00 test: fix for clang

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


clang complains:
> cmdlinenv00.c:35:11: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>                 if (ret < 0) {
>                     ~~~ ^ ~

The fix is to use ssize_t not size_t.

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

diff --git a/test/zdtm/static/cmdlinenv00.c b/test/zdtm/static/cmdlinenv00.c
index 9d3fe6c..90e7735 100644
--- a/test/zdtm/static/cmdlinenv00.c
+++ b/test/zdtm/static/cmdlinenv00.c
@@ -21,7 +21,7 @@ TEST_OPTION(arg3, string, "arg3", 1);
 
 static void read_from_proc(const char *path, char *buf, size_t size)
 {
-	size_t r = 0, ret;
+	ssize_t r = 0, ret;
 	int fd;
 
 	fd = open(path, O_RDONLY);
-- 
2.7.4



More information about the CRIU mailing list