From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 8 20:30:02 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A800106564A for ; Wed, 8 Aug 2012 20:30:02 +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 5F0D68FC14 for ; Wed, 8 Aug 2012 20:30:02 +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 q78KU2g3023228 for ; Wed, 8 Aug 2012 20:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q78KU2RI023221; Wed, 8 Aug 2012 20:30:02 GMT (envelope-from gnats) Resent-Date: Wed, 8 Aug 2012 20:30:02 GMT Resent-Message-Id: <201208082030.q78KU2RI023221@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan McGregor Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8D6F106566C for ; Wed, 8 Aug 2012 20:22:50 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id B9CDB8FC14 for ; Wed, 8 Aug 2012 20:22:50 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q78KMov3090323 for ; Wed, 8 Aug 2012 20:22:50 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q78KMomR090322; Wed, 8 Aug 2012 20:22:50 GMT (envelope-from nobody) Message-Id: <201208082022.q78KMomR090322@red.freebsd.org> Date: Wed, 8 Aug 2012 20:22:50 GMT From: Dan McGregor To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/170489: mkcsmapper doesn't build with clang X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2012 20:30:02 -0000 >Number: 170489 >Category: bin >Synopsis: mkcsmapper doesn't build with clang >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 08 20:30:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Dan McGregor >Release: 9 >Organization: >Environment: FreeBSD current.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #8 r238800M: Thu Jul 26 13:59:32 CST 2012 dan@shadrach.dyndns.org:/usr/obj/usr/src/sys/SHADRACH amd64 >Description: mkcsmapper doesn't use the "input" function emitted by lex. Since it's not needed clang throws a warning (new gcc does too), and FreeBSD is compiled with -Werror by default, causing a build error. (148) dan@current:/usr/src% make buildenv Entering world for amd64:amd64 (%h) %n@%m:%~%# cd usr.bin/mkcsmapper (%h) %n@%m:%~%# make lex -t /usr/src/usr.bin/mkcsmapper/lex.l > lex.c yacc -d -o yacc.c /usr/src/usr.bin/mkcsmapper/yacc.y clang -O2 -pipe -I/usr/src/usr.bin/mkcsmapper -I/usr/src/usr.bin/mkcsmapper/../mkcsmapper -I/usr/src/usr.bin/mkcsmapper/../../lib/libc/iconv -I/usr/src/usr.bin/mkcsmapper/../../lib/libiconv_modules/mapper_std --param max-inline-insns-single=64 -g -std=gnu99 -Qunused-arguments -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 -Wno-empty-body -Wno-string-plus-int -c lex.c /usr/src/usr.bin/mkcsmapper/lex.l:493: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 Stop in /usr/src/usr.bin/mkcsmapper. >How-To-Repeat: Try to build current with WITH_ICONV set and CC/CXX set to clang. >Fix: #define-ing YY_NO_INPUT in the lex input file solves this. Patch attached. Patch attached with submission follows: Index: lex.l =================================================================== --- lex.l (revision 239141) +++ lex.l (working copy) @@ -41,6 +41,7 @@ #include "ldef.h" #include "yacc.h" +#define YY_NO_INPUT int line_number = 1; %} %option nounput >Release-Note: >Audit-Trail: >Unformatted: