Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Dec 2014 19:37:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 196166] New: Fix net/mrouted build with clang 3.5.0
Message-ID:  <bug-196166-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196166

            Bug ID: 196166
           Summary: Fix net/mrouted build with clang 3.5.0
           Product: Ports Tree
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: hrs@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(hrs@FreeBSD.org)
          Assignee: hrs@FreeBSD.org

Created attachment 150819
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150819&action=edit
Fix net/mrouted build with clang 3.5.0

The net/mrouted port fails to compile with clang 3.5.0, due to the following
-Werror warning:

mtrace.c:923:12: error: taking the absolute value of unsigned type 'unsigned
int' has no effect [-Werror,-Wabsolute-value]
        if (*s || abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 100000) {
                  ^
mtrace.c:923:12: note: remove the call to 'abs' since unsigned values cannot be
negative
        if (*s || abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 100000) {
                  ^~~
1 error generated.

This is a bug in the code, because the return value of ntohl() is unsigned, and
the difference of two unsigned quantities is still unsigned.  However, the
intent of the expression is to look at the absolute difference between the two
quantities.

Therefore, similar to head r274898 [1] for rtadvd, introduce a small static
function that clarifies the intent, and call it instead.

[1] https://svnweb.freebsd.org/base?view=revision&revision=274898

--- Comment #1 from Bugzilla Automation <bugzilla@FreeBSD.org> ---
Auto-assigned to maintainer hrs@FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-196166-13>