Bug 224816

Summary: emulators/open-vm-tools: Fix build with clang 6.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Josh Paetzel <jpaetzel>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (jpaetzel)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 224669    
Attachments:
Description Flags
Fix tautological (endless) loop in vixTools.c none

Description Dimitry Andric freebsd_committer 2018-01-01 13:06:58 UTC
Created attachment 189312 [details]
Fix tautological (endless) loop in vixTools.c

While testing the new clang600-import branch (see bug 224669), I noticed that open-vm-tools fails to compile, due to a new warning in clang 6.0.0:

--- libvix_la-vixTools.lo ---
vixTools.c:7333:22: error: result of comparison 'int' <= 4294967295 is always true [-Werror,-Wtautological-constant-compare]
   for (var = 0; var <= 0xFFFFFFFF; var++) {
                 ~~~ ^  ~~~~~~~~~~
1 error generated.

Here is a patch to fix that particular error, and this also avoids an endless loop in practice.
Comment 1 Josh Paetzel freebsd_committer 2018-01-02 14:45:47 UTC
Committed, thanks.

I also submitted this fix upstream.

https://github.com/vmware/open-vm-tools/pull/221
Comment 2 commit-hook freebsd_committer 2018-01-02 14:45:50 UTC
A commit references this bug:

Author: jpaetzel
Date: Tue Jan  2 14:45:06 UTC 2018
New revision: 457864
URL: https://svnweb.freebsd.org/changeset/ports/457864

Log:
  Fix build with clang 6.0.0

  Also avoids an endless loop in practice

  PR:	224816
  Submitted by:	dim

Changes:
  head/emulators/open-vm-tools/Makefile
  head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c
Comment 3 Dimitry Andric freebsd_committer 2018-01-02 18:40:06 UTC
Josh, can you please MFH this to 2018Q1?
Comment 4 Josh Paetzel freebsd_committer 2018-01-02 18:49:25 UTC
Yes.
Comment 5 commit-hook freebsd_committer 2018-01-22 20:27:44 UTC
A commit references this bug:

Author: jpaetzel
Date: Mon Jan 22 20:27:01 UTC 2018
New revision: 459695
URL: https://svnweb.freebsd.org/changeset/ports/459695

Log:
  MFH: r457864

  Fix build with clang 6.0.0

  Also avoids an endless loop in practice

  PR:	224816
  Submitted by:	dim

  Approved by:	ports-secteam (swills)

Changes:
_U  branches/2018Q1/
  branches/2018Q1/emulators/open-vm-tools/Makefile
  branches/2018Q1/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c