[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bison-2.0a feedback: strlen problem
From: |
János Zoltán Szabó |
Subject: |
bison-2.0a feedback: strlen problem |
Date: |
Mon, 30 May 2005 14:29:43 +0200 |
Dear All,
I think there is a little problem with bison-2.0a. Line 1157 of yacc.c
refers to 'strlen' instead of 'yystrlen':
yysize1 = yysize + strlen (yyf);
This might lead to a compilation problem if bison's own yystrlen is
active and string.h is not included in the grammar file.
It would be better to write this:
yysize1 = yysize + yystrlen (yyf);
Here is a minimized example that triggers the problem:
%{
#define YYERROR_VERBOSE
extern int yylex(void);
extern void yyerror(char*);
%}
%%
Sentence: ;
When the parser is compiled as C gcc complains about the implicit
declaration of 'strlen'. However, if it is compiled as C++ the warning
becomes an error.
Regards,
Zoltan
- bison-2.0a feedback: strlen problem,
János Zoltán Szabó <=
Re: bison-2.0a feedback: strlen problem, Paul Eggert, 2005/05/31