From: Oliver Kurth Date: Wed, 7 Feb 2018 00:32:37 +0000 (-0800) Subject: Fix error reported by clang 6.0.0 - comparison 'int' <= 4294967295 is always true X-Git-Tag: stable-10.3.0~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=076b7201b61af9f3dcb36050ff37a8145a05d404;p=thirdparty%2Fopen-vm-tools.git Fix error reported by clang 6.0.0 - comparison 'int' <= 4294967295 is always true Fix the logical constant compare warning/error in vixTools.c of the vix plugin. Rewrite the continuous for loop to simply iterate from zero to MAX_INT32. --- diff --git a/open-vm-tools/AUTHORS b/open-vm-tools/AUTHORS index de6a1eba3..a82f4a6ac 100644 --- a/open-vm-tools/AUTHORS +++ b/open-vm-tools/AUTHORS @@ -17,3 +17,5 @@ Sebastian Parschauer Add support to properly report SLES12-SAP Andrew Stormont Fix finding C++ compiler for cross-compiling - https://github.com/vmware/open-vm-tools/pull/206 +Josh Paetzel Fix compilation error in clang 6.0 + - https://github.com/vmware/open-vm-tools/pull/221 diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c index ada04183b..435b934ad 100644 --- a/open-vm-tools/services/plugins/vix/vixTools.c +++ b/open-vm-tools/services/plugins/vix/vixTools.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -7330,7 +7330,7 @@ VixToolsRunScript(VixCommandRequestHeader *requestMsg, // IN goto abort; } } - for (var = 0; var <= 0xFFFFFFFF; var++) { + for (var = 0; var < MAX_INT32; var++) { free(tempScriptFilePath); tempScriptFilePath = Str_SafeAsprintf(NULL, "%s"DIRSEPS"%s%d%s",