bug-bison
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]