Bug 206337

Summary: devel/dee: fix build with clang 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (olivierd)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 206074    
Attachments:
Description Flags
Parenthesize journal_iter_is_removed macro so it doesn't cause warnings none

Description Dimitry Andric freebsd_committer freebsd_triage 2016-01-17 14:56:08 UTC
Created attachment 165718 [details]
Parenthesize journal_iter_is_removed macro so it doesn't cause warnings

During the exp-run in bug 206074, it was found that devel/dee gives errors with a recent clang 3.8.0 snapshot:

dee-transaction.c:1245:17: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
      g_assert (!journal_iter_is_removed (jiter));
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/glib-2.0/glib/gtestutils.h:106:59: note: expanded from macro 'g_assert'
                                             if G_LIKELY (expr) ; else \
                                                          ^~~~
/usr/local/include/glib-2.0/glib/gmacros.h:325:59: note: expanded from macro 'G_LIKELY'
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
                                                          ^~~~
/usr/local/include/glib-2.0/glib/gmacros.h:319:8: note: expanded from macro '_G_BOOLEAN_EXPR'
   if (expr)                                    \
       ^~~~
dee-transaction.c:1245:17: note: add parentheses after the '!' to evaluate the comparison first
dee-transaction.c:1245:17: note: add parentheses around left hand side expression to silence this warning
1 error generated.

This is because the journal_iter_is_removed() macro does not have parentheses around its expression.  Here is a patch to fix that.
Comment 1 Olivier Duchateau freebsd_committer freebsd_triage 2016-01-24 11:14:40 UTC
Feel free to commit, it's ok for me.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-01-24 14:58:40 UTC
A commit references this bug:

Author: dim
Date: Sun Jan 24 14:57:37 UTC 2016
New revision: 407133
URL: https://svnweb.freebsd.org/changeset/ports/407133

Log:
  Fix warnings from clang 3.8.0 about a non-parenthesized macro in
  devel/dee.

  Approved by:	olivierd (maintainer)
  PR:		206337

Changes:
  head/devel/dee/files/
  head/devel/dee/files/patch-src__dee-transaction.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-01-24 15:35:01 UTC
A commit references this bug:

Author: feld
Date: Sun Jan 24 15:34:00 UTC 2016
New revision: 407157
URL: https://svnweb.freebsd.org/changeset/ports/407157

Log:
  MFH: r407133

  Fix warnings from clang 3.8.0 about a non-parenthesized macro in
  devel/dee.

  Approved by:	olivierd (maintainer)
  PR:		206337

  Approved by:	ports-secteam (with hat)

Changes:
_U  branches/2016Q1/
  branches/2016Q1/devel/dee/files/