From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Dec 18 23:20:05 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A343F106566B for ; Sun, 18 Dec 2011 23:20:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 78C438FC14 for ; Sun, 18 Dec 2011 23:20:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBINK5WB019491 for ; Sun, 18 Dec 2011 23:20:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBINK5NR019490; Sun, 18 Dec 2011 23:20:05 GMT (envelope-from gnats) Resent-Date: Sun, 18 Dec 2011 23:20:05 GMT Resent-Message-Id: <201112182320.pBINK5NR019490@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jan Beich Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0DA106564A for ; Sun, 18 Dec 2011 23:10:39 +0000 (UTC) (envelope-from jbeich@tormail.net) Received: from server2.hudsonvalleyhost.com (server2.hudsonvalleyhost.com [66.7.195.77]) by mx1.freebsd.org (Postfix) with ESMTP id 155838FC0C for ; Sun, 18 Dec 2011 23:10:38 +0000 (UTC) Received: from tor-proxy.vm.31173.se ([193.138.216.101]:56190 helo=internal.tormail.net) by server2.hudsonvalleyhost.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from ) id 1RcPsK-003UsI-MH for FreeBSD-gnats-submit@freebsd.org; Sun, 18 Dec 2011 18:10:38 -0500 Received: from jbeich by internal.tormail.net with local (Exim 4.63) (envelope-from ) id 1RcPr1-000A1V-My for FreeBSD-gnats-submit@freebsd.org; Sun, 18 Dec 2011 23:09:17 +0000 Message-Id: <1RcPr1-000A1V-My@internal.tormail.net> Date: Sun, 18 Dec 2011 20:57:25 -0200 From: Jan Beich To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: ports/163440: [patch] sysutils/uhidd: unbreak build on clang/gcc46 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 23:20:05 -0000 >Number: 163440 >Category: ports >Synopsis: [patch] sysutils/uhidd: unbreak build on clang/gcc46 >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: Sun Dec 18 23:20:04 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Jan Beich >Release: FreeBSD 10.0-CURRENT amd64 >Organization: >Environment: >Description: >How-To-Repeat: $ __MAKE_CONF= make CC=clang [...] clang -O2 -pipe -fno-strict-aliasing -I. -I/usr/ports/sysutils/uhidd/work/uhidd-0.2.0/uhidd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c uhidd_hidump.c uhidd_hidump.c:299:30: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] nibble = (dval >> (i * 4)) && 0x0F; ^ ~~~~ uhidd_hidump.c:299:30: note: use '&' for a bitwise operation nibble = (dval >> (i * 4)) && 0x0F; ^~ & uhidd_hidump.c:299:30: note: remove constant to silence this warning nibble = (dval >> (i * 4)) && 0x0F; ^~~~~~~ 1 error generated. *** [uhidd_hidump.o] Error code 1 [...] lex -t lex.l > lex.c clang -O2 -pipe -fno-strict-aliasing -I. -I/usr/ports/sysutils/uhidd/work/uhidd-0.2.0/uhidd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c lex.c lex.l:486:12: error: function 'input' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static int input(void) ^ 1 error generated. *** [lex.o] Error code 1 $ __MAKE_CONF= make CC=gcc46 [...] gcc46 -O2 -pipe -fno-strict-aliasing -I. -I/usr/ports/sysutils/uhidd/work/uhidd-0.2.0/uhidd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c uhidd.c uhidd.c: In function 'open_device': uhidd.c:316:39: error: variable 'ddesc' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors *** [uhidd.o] Error code 1 >Fix: --- clang.diff begins here --- Index: sysutils/uhidd/files/patch-hidump.c =================================================================== RCS file: sysutils/uhidd/files/patch-hidump.c diff -N sysutils/uhidd/files/patch-hidump.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/uhidd/files/patch-hidump.c 29 Jul 2011 21:03:15 -0000 @@ -0,0 +1,11 @@ +--- uhidd/uhidd_hidump.c~ ++++ uhidd/uhidd_hidump.c +@@ -296,7 +296,7 @@ get_unit(int dval, unsigned int sz) + + normal: + for (i = 1; (unsigned int)i < sz * 2; i++) { +- nibble = (dval >> (i * 4)) && 0x0F; ++ nibble = (dval >> (i * 4)) & 0x0F; + if (!nibble) + continue; + if (nibble > 7) Index: sysutils/uhidd/files/patch-uhidd-lex.l =================================================================== RCS file: sysutils/uhidd/files/patch-uhidd-lex.l diff -N sysutils/uhidd/files/patch-uhidd-lex.l --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/uhidd/files/patch-uhidd-lex.l 18 Dec 2011 22:51:09 -0000 @@ -0,0 +1,19 @@ +--- uhidd/lex.l~ ++++ uhidd/lex.l +@@ -34,7 +34,6 @@ + + #include "y.tab.h" + +-#define YY_NO_UNPUT + int lineno = 1; + + int yylex(void); +@@ -42,6 +41,8 @@ + %} + + %option noyywrap ++%option nounput ++%option noinput + + %% + Index: sysutils/uhidd/files/patch-uhidd-uhidd.c =================================================================== RCS file: sysutils/uhidd/files/patch-uhidd-uhidd.c diff -N sysutils/uhidd/files/patch-uhidd-uhidd.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/uhidd/files/patch-uhidd-uhidd.c 18 Dec 2011 22:49:51 -0000 @@ -0,0 +1,19 @@ +--- uhidd/uhidd.c~ ++++ uhidd/uhidd.c +@@ -313,7 +313,6 @@ + static int + open_device(const char *dev, struct libusb20_device *pdev) + { +- struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + struct libusb20_config *config; + struct libusb20_interface *iface; + int cndx, e, i; +@@ -334,8 +333,6 @@ open_device(const char *dev, struct libu + return (-1); + } + +- ddesc = libusb20_dev_get_device_desc(pdev); +- + /* + * Iterate each interface. + */ --- clang.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: