bin/170489: mkcsmapper doesn't build with clang
Dan McGregor
dan.mcgregor at usask.ca
Wed Aug 8 20:30:02 UTC 2012
>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 at 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 at 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:
More information about the freebsd-bugs
mailing list