From uqs@spoerlein.net  Fri Oct  2 21:16:29 2009
Return-Path: <uqs@spoerlein.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E71EE1065676
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <uqs@spoerlein.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: flex: fix prototypes, esp. when YY_NO_INPUT is defined
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         139319
>Category:       bin
>Synopsis:       [patch] flex(1): fix prototypes, esp. when YY_NO_INPUT is defined
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    uqs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 02 21:20:01 UTC 2009
>Closed-Date:    Thu Nov 04 12:44:16 UTC 2010
>Last-Modified:  Thu Nov 04 12:44:16 UTC 2010
>Originator:     Ulrich Spoerlein
>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:
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Sat Jan 30 12:32:58 UTC 2010 
State-Changed-Why:  
This has been probably fixed by r201289. Can you confirm? 


Responsible-Changed-From-To: freebsd-bugs->jh 
Responsible-Changed-By: jh 
Responsible-Changed-When: Sat Jan 30 12:32:58 UTC 2010 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139319 
State-Changed-From-To: feedback->patched 
State-Changed-By: jh 
State-Changed-When: Mon Feb 1 15:53:42 UTC 2010 
State-Changed-Why:  
Fixed in head by r201289. 


Responsible-Changed-From-To: jh->freebsd-bugs 
Responsible-Changed-By: jh 
Responsible-Changed-When: Mon Feb 1 15:53:42 UTC 2010 
Responsible-Changed-Why:  
Back to -bugs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139319 
Responsible-Changed-From-To: freebsd-bugs->uqs 
Responsible-Changed-By: uqs 
Responsible-Changed-When: Thu Feb 4 08:21:31 UTC 2010 
Responsible-Changed-Why:  
Grab my own PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139319 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/139319: commit references a PR
Date: Sun, 24 Oct 2010 15:31:47 +0000 (UTC)

 Author: uqs
 Date: Sun Oct 24 15:31:41 2010
 New Revision: 214272
 URL: http://svn.freebsd.org/changeset/base/214272
 
 Log:
   flex: add missing ifdef magic to create/hide prototypes
   
   This unbreaks build for some software with higher WARNS flags.
   
   Reviewed by:	rpaulo
   PR:		bin/139319 (parts already committed in previous revision)
 
 Modified:
   head/usr.bin/lex/flex.skl
 
 Modified: head/usr.bin/lex/flex.skl
 ==============================================================================
 --- head/usr.bin/lex/flex.skl	Sun Oct 24 13:48:11 2010	(r214271)
 +++ head/usr.bin/lex/flex.skl	Sun Oct 24 15:31:41 2010	(r214272)
 @@ -747,7 +747,11 @@ void yyFlexLexer::LexerOutput( const cha
   */
  
  %-
 +#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 @@ int yyFlexLexer::yy_get_next_buffer()
  /* 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()
  %*
 @@ -983,7 +991,11 @@ void yyFlexLexer::yyunput( int c, char* 
  #ifdef __cplusplus
  static int yyinput()
  #else
 +#ifdef YY_USE_PROTOS
  static int input(void)
 +#else
 +static int input()
 +#endif
  #endif
  %+
  int yyFlexLexer::yyinput()
 @@ -1055,7 +1067,9 @@ int yyFlexLexer::yyinput()
  
  	return c;
  	}
 -#endif /* ifndef YY_NO_INPUT */
 +%-
 +#endif	/* ifndef YY_NO_INPUT */
 +%*
  
  
  %-
 @@ -1404,7 +1418,11 @@ void yyFlexLexer::yy_push_state( int new
  
  #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()
  %*
 @@ -1419,7 +1437,11 @@ void yyFlexLexer::yy_pop_state()
  
  #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()
  %*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: uqs 
State-Changed-When: Thu Nov 4 12:43:53 UTC 2010 
State-Changed-Why:  
Merged to stable/8 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139319 
>Unformatted:
