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.
This commit is contained in:
Ed Schouten 2009-12-30 22:46:08 +00:00
parent 6a41dc1043
commit a6c287f615
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201289
3 changed files with 10 additions and 6 deletions

View File

@ -747,7 +747,7 @@ void yyFlexLexer::LexerOutput( const char* buf, int size )
*/
%-
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* yy_bp )
#ifdef __cplusplus
static int yyinput()
#else
static int input()
static int input(void)
#endif
%+
int yyFlexLexer::yyinput()

View File

@ -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;

View File

@ -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;",