Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2014 17:10:46 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 196137] New: Fix net/dpdk build with clang 3.5.0
Message-ID:  <bug-196137-13@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 196137
           Summary: Fix net/dpdk 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: freebsd-ports-bugs@FreeBSD.org
          Reporter: dim@FreeBSD.org
                CC: bruce.richardson@intel.com
             Flags: maintainer-feedback?(bruce.richardson@intel.com)
                CC: bruce.richardson@intel.com

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

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

/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:93:38:
error: size argument in 'strncmp' call is a comparison
[-Werror,-Wmemsize-comparison]
                        sizeof(devargs->virtual.drv_name) != 0))
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:92:6: note:
did you mean to compare the result of 'strncmp' instead?
        if (strncmp(devargs->virtual.drv_name, "eth_ring1",
            ^
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:93:4: note:
explicitly cast the argument to size_t to silence this warning
                        sizeof(devargs->virtual.drv_name) != 0))
                        ^
                        (size_t)(                             )
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:69:
error: size argument in 'strncmp' call is a comparison
[-Werror,-Wmemsize-comparison]
        if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) !=
0))
                                                     ~~~~~~~~~~~~~~~~~~~~~~^~~~
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:6: note:
did you mean to compare the result of 'strncmp' instead?
        if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) !=
0))
            ^                                                                 
~
                                                                          )
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:47:
note: explicitly cast the argument to size_t to silence this warning
        if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) !=
0))
                                                     ^
                                                     (size_t)(                
)
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:55:
error: size argument in 'strncmp' call is a comparison
[-Werror,-Wmemsize-comparison]
        if (strncmp(devargs->args, "", sizeof(devargs->args) != 0))
                                       ~~~~~~~~~~~~~~~~~~~~~~^~~~
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:6:
note: did you mean to compare the result of 'strncmp' instead?
        if (strncmp(devargs->args, "", sizeof(devargs->args) != 0))
            ^                                                    ~
                                                            )
/wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:33:
note: explicitly cast the argument to size_t to silence this warning
        if (strncmp(devargs->args, "", sizeof(devargs->args) != 0))
                                       ^
                                       (size_t)(                 )
3 errors generated.

Clang has found a bug in this code: the parentheses for the strncmp() call are
incorrectly placed.  Fix this by moving the parentheses to before the !=
operator.

--- Comment #1 from Bugzilla Automation <bugzilla@FreeBSD.org> ---
Maintainer CC'd

-- 
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-196137-13>