From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 22:46:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477C61065696; Wed, 30 Dec 2009 22:46:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35D138FC1A; Wed, 30 Dec 2009 22:46:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUMk9xw075017; Wed, 30 Dec 2009 22:46:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUMk9Ta075013; Wed, 30 Dec 2009 22:46:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912302246.nBUMk9Ta075013@svn.freebsd.org> From: Ed Schouten Date: Wed, 30 Dec 2009 22:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201289 - in head/usr.bin: lex yacc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 22:46:09 -0000 Author: ed Date: Wed Dec 30 22:46:08 2009 New Revision: 201289 URL: http://svn.freebsd.org/changeset/base/201289 Log: 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. Modified: head/usr.bin/lex/flex.skl head/usr.bin/lex/initscan.c head/usr.bin/yacc/skeleton.c Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/lex/flex.skl Wed Dec 30 22:46:08 2009 (r201289) @@ -747,7 +747,7 @@ void yyFlexLexer::LexerOutput( const cha */ %- -static int yy_get_next_buffer() +static int yy_get_next_buffer(void) %+ int yyFlexLexer::yy_get_next_buffer() %* @@ -883,7 +883,7 @@ int yyFlexLexer::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 yyFlexLexer::yy_get_previous_state() %* @@ -982,7 +982,7 @@ void yyFlexLexer::yyunput( int c, char* #ifdef __cplusplus static int yyinput() #else -static int input() +static int input(void) #endif %+ int yyFlexLexer::yyinput() Modified: head/usr.bin/lex/initscan.c ============================================================================== --- head/usr.bin/lex/initscan.c Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/lex/initscan.c Wed Dec 30 22:46:08 2009 (r201289) @@ -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: head/usr.bin/yacc/skeleton.c ============================================================================== --- head/usr.bin/yacc/skeleton.c Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/yacc/skeleton.c Wed Dec 30 22:46:08 2009 (r201289) @@ -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;",