From 6a0e6abcd3fae207d9ffa42bc80b94ae7116840b Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 8 Nov 2017 16:42:56 -0700 Subject: [PATCH] vhost: use int to store getopt() return value getopt() returns int, not char, so assigning the return value into a char will truncate it. Fixes a warning on platforms where char is unsigned: vhost.c:109:61: warning: comparison is always true due to limited range of data type [-Wtype-limits] Change-Id: I3a290096346db241a473434952e0f5fd69e98c2f Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/386347 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Ziye Yang Reviewed-by: Pawel Wodkowski Reviewed-by: Jim Harris --- app/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vhost/vhost.c b/app/vhost/vhost.c index 9253d871f..6f6c150dd 100644 --- a/app/vhost/vhost.c +++ b/app/vhost/vhost.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) { struct spdk_app_opts opts = {}; - char ch; + int ch; int rc; const char *socket_path = NULL; enum spdk_log_level print_level = SPDK_LOG_NOTICE;