Date: Sun, 18 Dec 2011 20:57:25 -0200 From: Jan Beich <jbeich@tormail.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/163440: [patch] sysutils/uhidd: unbreak build on clang/gcc46 Message-ID: <1RcPr1-000A1V-My@internal.tormail.net> Resent-Message-ID: <201112182320.pBINK5NR019490@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1RcPr1-000A1V-My>