Bug 196108 - Fix emulators/open-vm-tools(-nox11) build with clang 3.5.0
Summary: Fix emulators/open-vm-tools(-nox11) build with clang 3.5.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Steve Wills
Depends on:
Blocks: 195480
  Show dependency treegraph
Reported: 2014-12-18 20:33 UTC by Dimitry Andric
Modified: 2015-02-14 13:39 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (swills)

Fix emulators/open-vm-tools(-nox11) build with clang 3.5.0 (1.33 KB, patch)
2014-12-18 20:33 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2014-12-18 20:33:08 UTC
Created attachment 150735 [details]
Fix emulators/open-vm-tools(-nox11) build with clang 3.5.0

The emulators/open-vm-tools and its -nox11 variant ports fail to compile with clang 3.5.0, due to the following -Werror warning:

toolboxcmd-shrink.c:394:31: error: comparison of constant 'WIPER_ENABLED' (2) with boolean expression is always false [-Werror,-Wtautological-constant-out-of-range-compare]
   if (!ShrinkGetWiperState() == WIPER_ENABLED && !Wiper_IsWipeSupported(part)) {
       ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
1 error generated.

This is a logic error in the code, the ! operator applies to the left hand part of the == expression, while WIPER_ENABLED is one of three possible enum values.

The code should use "ShrinkGetWiperState() != WIPER_ENABLED" instead.
Comment 1 Bugzilla Automation freebsd_committer 2014-12-18 20:33:08 UTC
Auto-assigned to maintainer swills@FreeBSD.org
Comment 2 commit-hook freebsd_committer 2015-02-14 13:37:49 UTC
A commit references this bug:

Author: kwm
Date: Sat Feb 14 13:36:49 UTC 2015
New revision: 378961
URL: https://svnweb.freebsd.org/changeset/ports/378961

  Fix build with clang 3.5.0.

  PR:		196108
  Submitted by:	dim@
  Approved by:	maintainer (via IRC)