From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 2 21:20:02 2009 Return-Path: Delivered-To: freebsd-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 A3C461065705 for ; Fri, 2 Oct 2009 21:20: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 7B0C98FC20 for ; Fri, 2 Oct 2009 21:20:02 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n92LK2hB066813 for ; Fri, 2 Oct 2009 21:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n92LK1IA066812; Fri, 2 Oct 2009 21:20:01 GMT (envelope-from gnats) Resent-Date: Fri, 2 Oct 2009 21:20:01 GMT Resent-Message-Id: <200910022120.n92LK1IA066812@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, Ulrich Spoerlein Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71EE1065676 for ; Fri, 2 Oct 2009 21:16:29 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (cl-43.dus-01.de.sixxs.net [IPv6:2a01:198:200:2a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 609168FC0A for ; Fri, 2 Oct 2009 21:16:29 +0000 (UTC) Received: from roadrunner.spoerlein.net (p54957533.dip.t-dialin.net [84.149.117.51]) by acme.spoerlein.net (8.14.3/8.14.3) with ESMTP id n92LGQG7095124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Oct 2009 23:16:27 +0200 (CEST) (envelope-from uqs@spoerlein.net) Received: from roadrunner.spoerlein.net (localhost [127.0.0.1]) by roadrunner.spoerlein.net (8.14.3/8.14.3) with ESMTP id n92H7Ocl029326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Oct 2009 19:07:25 +0200 (CEST) (envelope-from uqs@roadrunner.spoerlein.net) Received: (from uqs@localhost) by roadrunner.spoerlein.net (8.14.3/8.14.3/Submit) id n92H7ONP029322; Fri, 2 Oct 2009 19:07:24 +0200 (CEST) (envelope-from uqs) Message-Id: <200910021707.n92H7ONP029322@roadrunner.spoerlein.net> Date: Fri, 2 Oct 2009 19:07:24 +0200 (CEST) From: Ulrich Spoerlein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/139319: flex: fix prototypes, esp. when YY_NO_INPUT is defined 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: Fri, 02 Oct 2009 21:20:02 -0000 >Number: 139319 >Category: bin >Synopsis: flex: fix prototypes, esp. when YY_NO_INPUT is defined >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 02 21:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Ulrich Spörlein >Release: FreeBSD 8.0-BETA4 i386 >Organization: >Environment: >Description: When YY_NO_INPUT is defined, the input function body will still be emitted, but not the prototype. This breaks build for some software with higher WARNS flags. >How-To-Repeat: Grab games/atc from DragonflyBSD and try to compile with WARNS>2 >Fix: The fix is taken straight from DragonflyBSD, it adds more prototypes in the YY_USE_PROTOS case and adds the missing #ifdef glue around input() (compare this with what's done to unput()) --- flex.diff begins here --- --- a/usr.bin/lex/flex.skl Fri Oct 02 14:16:27 2009 +0200 +++ b/usr.bin/lex/flex.skl Fri Oct 02 18:56:51 2009 +0200 @@ -747,7 +747,11 @@ */ %- +#ifdef YY_USE_PROTOS +static int yy_get_next_buffer( void ) +#else static int yy_get_next_buffer() +#endif %+ int yyFlexLexer::yy_get_next_buffer() %* @@ -883,7 +887,11 @@ /* yy_get_previous_state - get the state just before the EOB char was reached */ %- +#ifdef YY_USE_PROTOS +static yy_state_type yy_get_previous_state( void ) +#else static yy_state_type yy_get_previous_state() +#endif %+ yy_state_type yyFlexLexer::yy_get_previous_state() %* @@ -979,11 +987,16 @@ %- +#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else +#ifdef YY_USE_PROTOS +static int input( void ) +#else static int input() #endif +#endif %+ int yyFlexLexer::yyinput() %* @@ -1054,6 +1067,9 @@ return c; } +%- +#endif /* ifndef YY_NO_INPUT */ +%* %- @@ -1402,7 +1418,11 @@ #ifndef YY_NO_POP_STATE %- +#ifdef YY_USE_PROTOS +static void yy_pop_state( void ) +#else static void yy_pop_state() +#endif %+ void yyFlexLexer::yy_pop_state() %* @@ -1417,7 +1437,11 @@ #ifndef YY_NO_TOP_STATE %- +#ifdef YY_USE_PROTOS +static int yy_top_state( void ) +#else static int yy_top_state() +#endif %+ int yyFlexLexer::yy_top_state() %* --- flex.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: