ports/174971: [net/mrouted] cant build on -CUREENT with clang

Vincent Hoffman-Kazlauskas vince at unsane.co.uk
Fri Jan 4 14:50:01 UTC 2013


>Number:         174971
>Category:       ports
>Synopsis:       [net/mrouted] cant build on -CUREENT with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 04 14:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Vincent Hoffman-Kazlauskas
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD ostracod.unsane.co.uk 10.0-CURRENT FreeBSD 10.0-CURRENT #29 r244393: Tue Dec 18 22:42:06 GMT 2012     toor at ostracod.unsane.co.uk:/usr/obj/usr/src/sys/OSTRACOD  amd64
>Description:
The macro VIFM_ISEMPTY in vif.h defines
#define VIFM_ISEMPTY(m)                 ((m) == 0)
but was being used in prune.c with extra parentheses

if (VIFM_ISEMPTY(gt->gt_grpmems))

This was causing clang to error out with multiple
prune.c:1421:24: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
  if (((g->gt_grpmems) == 0))
       ~~~~~~~~~~~~~~~~^~~~
prune.c:1421:24: note: remove extraneous parentheses around the comparison to silence this warning
  if (((g->gt_grpmems) == 0))
      ~                ^   ~
prune.c:1421:24: note: use '=' to turn this equality comparison into an assignment
  if (((g->gt_grpmems) == 0))
                       ^~
                       =
4 errors generated.
gmake: *** [prune.o] Error 1
*** [do-build] Error code 1


>How-To-Repeat:
cd /usr/ports/net/mrouted
make

on a machine using clang as its compiler.


>Fix:
I fixed it by changing the entries in prune.c, however i'm not much of a programmer so it may be better to fix elsewhere. patch that works for me(tm) attached.

Patch attached with submission follows:

--- prune.c.orig        2013-01-04 14:38:54.344876518 +0000
+++ prune.c     2013-01-04 14:39:00.949874697 +0000
@@ -129,7 +129,7 @@
  */
 void send_prune_or_graft(struct gtable *gt)
 {
-    if (VIFM_ISEMPTY(gt->gt_grpmems))
+    if VIFM_ISEMPTY(gt->gt_grpmems)
        send_prune(gt);
     else if (gt->gt_prsent_timer)
        send_graft(gt);
@@ -837,7 +837,7 @@
      * If there are no downstream routers that want traffic for
      * this group, send (or retransmit) a prune upstream.
      */
-    if (VIFM_ISEMPTY(gt->gt_grpmems))
+    if VIFM_ISEMPTY(gt->gt_grpmems)
        send_prune(gt);
 }
 
@@ -1149,7 +1149,7 @@
 
            VIFM_SET(vifi, g->gt_grpmems);
            APPLY_SCOPE(g);
-           if (VIFM_ISEMPTY(g->gt_grpmems))
+           if VIFM_ISEMPTY(g->gt_grpmems)
                continue;
 
            prun_add_ttls(g);
@@ -1418,7 +1418,7 @@
                 * ignore it ; don't graft back
                 */
                APPLY_SCOPE(g);
-               if (VIFM_ISEMPTY(g->gt_grpmems))
+               if VIFM_ISEMPTY(g->gt_grpmems)
                    continue;
 
                /* send graft upwards */


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list