Bug 212426 - emulators/open-vm-tools emulators/open-vm-tools-nox11: Fix build with clang 3.9.0
Summary: emulators/open-vm-tools emulators/open-vm-tools-nox11: Fix build with clang 3...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Steve Wills
URL:
Keywords:
: 215366 (view as bug list)
Depends on:
Blocks: 212343
  Show dependency treegraph
 
Reported: 2016-09-06 18:49 UTC by Dimitry Andric
Modified: 2016-12-17 23:20 UTC (History)
1 user (show)

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


Attachments
Make definition of __IS_FREEBSD__ more portable (1.21 KB, patch)
2016-09-06 18:49 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 2016-09-06 18:49:55 UTC
Created attachment 174432 [details]
Make definition of __IS_FREEBSD__ more portable

While testing the clang390-import branch, building emulators/open-vm-tools or emulators/open-vm-tools-nox11 results in the following -Werror warnings:

hgfsServerLinux.c:1989:8: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#   if __IS_FREEBSD_VER__(500043)
       ^
/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include/vm_basic_defs.h:85:34: note: expanded from macro '__IS_FREEBSD_VER__'
#define __IS_FREEBSD_VER__(ver) (__IS_FREEBSD__ && __FreeBSD_version >= (ver))
                                 ^
/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include/vm_basic_defs.h:84:26: note: expanded from macro '__IS_FREEBSD__'
#define __IS_FREEBSD__ (!defined(VMKERNEL) && defined(__FreeBSD__))
                         ^
hgfsServerLinux.c:1989:8: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include/vm_basic_defs.h:85:34: note: expanded from macro '__IS_FREEBSD_VER__'
#define __IS_FREEBSD_VER__(ver) (__IS_FREEBSD__ && __FreeBSD_version >= (ver))
                                 ^
--- hgfsDirNotifyStub.lo ---
mv -f .deps/hgfsDirNotifyStub.Tpo .deps/hgfsDirNotifyStub.Plo
--- hgfsServerLinux.lo ---
/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include/vm_basic_defs.h:84:47: note: expanded from macro '__IS_FREEBSD__'
#define __IS_FREEBSD__ (!defined(VMKERNEL) && defined(__FreeBSD__))
                                              ^
2 errors generated.

This is because the macro __IS_FREEBSD__ expands to something with defined() in it, which is undefined.  Fix it by using a more portable way of defining __IS_FREEBSD__.
Comment 1 commit-hook freebsd_committer 2016-09-12 01:38:00 UTC
A commit references this bug:

Author: swills
Date: Mon Sep 12 01:37:19 UTC 2016
New revision: 421892
URL: https://svnweb.freebsd.org/changeset/ports/421892

Log:
  emulators/open-vm-tools: Fix build with clang 3.9.0

  PR:		212426
  Submitted by:	dim

Changes:
  head/emulators/open-vm-tools/files/patch-lib_include_vm__basic__defs.h
Comment 2 Steve Wills freebsd_committer 2016-09-12 01:50:47 UTC
Committed, thanks!
Comment 3 Enji Cooper freebsd_committer 2016-12-17 23:20:46 UTC
*** Bug 215366 has been marked as a duplicate of this bug. ***