svn commit: r214779 - in stable/8/usr.bin: lex yacc
Ulrich Spoerlein
uqs at FreeBSD.org
Thu Nov 4 10:53:51 UTC 2010
Author: uqs
Date: Thu Nov 4 10:53:50 2010
New Revision: 214779
URL: http://svn.freebsd.org/changeset/base/214779
Log:
MFC r200626,201289,213764,214272, syncing yacc and flex to -CURRENT
r200626:
remove external reference to not (or at least no longer) existing variable 'myname'
r201289:
Let both yacc and lex generate code that passes -Wold-style-definition.
Both these tools emit code where several functions have no `void'
keyword placed in the arugment list when the function has no arguments.
r213764:
Don't define the input() function ifdef YY_NO_INPUT.
This was previously done for the input() function.
r214272:
flex: add missing ifdef magic to create/hide prototypes
This unbreaks build for some software with higher WARNS flags.
Modified:
stable/8/usr.bin/lex/flex.skl
stable/8/usr.bin/lex/initscan.c
stable/8/usr.bin/yacc/defs.h
stable/8/usr.bin/yacc/skeleton.c
Directory Properties:
stable/8/usr.bin/lex/ (props changed)
stable/8/usr.bin/yacc/ (props changed)
Modified: stable/8/usr.bin/lex/flex.skl
==============================================================================
--- stable/8/usr.bin/lex/flex.skl Thu Nov 4 10:47:19 2010 (r214778)
+++ stable/8/usr.bin/lex/flex.skl Thu Nov 4 10:53:50 2010 (r214779)
@@ -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()
%*
@@ -979,11 +987,16 @@ void yyFlexLexer::yyunput( int c, char*
%-
+#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 @@ int yyFlexLexer::yyinput()
return c;
}
+%-
+#endif /* ifndef YY_NO_INPUT */
+%*
%-
@@ -1402,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()
%*
@@ -1417,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()
%*
Modified: stable/8/usr.bin/lex/initscan.c
==============================================================================
--- stable/8/usr.bin/lex/initscan.c Thu Nov 4 10:47:19 2010 (r214778)
+++ stable/8/usr.bin/lex/initscan.c Thu Nov 4 10:53:50 2010 (r214779)
@@ -2894,7 +2894,7 @@ case YY_STATE_EOF(LINEDIR):
* EOB_ACT_END_OF_FILE - end of file
*/
-static int yy_get_next_buffer()
+static int yy_get_next_buffer(void)
{
char *dest = yy_current_buffer->yy_ch_buf;
char *source = yytext_ptr;
@@ -3026,7 +3026,7 @@ static int yy_get_next_buffer()
/* yy_get_previous_state - get the state just before the EOB char was reached */
-static yy_state_type yy_get_previous_state()
+static yy_state_type yy_get_previous_state(void)
{
yy_state_type yy_current_state;
char *yy_cp;
@@ -3138,7 +3138,7 @@ char *yy_bp;
#ifdef __cplusplus
static int yyinput()
#else
-static int input()
+static int input(void)
#endif
{
int c;
Modified: stable/8/usr.bin/yacc/defs.h
==============================================================================
--- stable/8/usr.bin/yacc/defs.h Thu Nov 4 10:47:19 2010 (r214778)
+++ stable/8/usr.bin/yacc/defs.h Thu Nov 4 10:53:50 2010 (r214779)
@@ -220,7 +220,6 @@ extern char tflag;
extern char vflag;
extern const char *symbol_prefix;
-extern char *myname;
extern char *cptr;
extern char *line;
extern int lineno;
Modified: stable/8/usr.bin/yacc/skeleton.c
==============================================================================
--- stable/8/usr.bin/yacc/skeleton.c Thu Nov 4 10:47:19 2010 (r214778)
+++ stable/8/usr.bin/yacc/skeleton.c Thu Nov 4 10:53:50 2010 (r214779)
@@ -140,7 +140,11 @@ const char *header[] =
const char *body[] =
{
"/* allocate initial stack or double stack size, up to YYMAXDEPTH */",
+ "#if defined(__cplusplus) || __STDC__",
+ "static int yygrowstack(void)",
+ "#else",
"static int yygrowstack()",
+ "#endif",
"{",
" int newsize, i;",
" short *newss;",
More information about the svn-src-stable
mailing list