Le 13 janv. 2010 à 21:51, Joel E. Denny a écrit :

>> #ifndef yyerror
>> #define yyerror(x) { \
>>       SPRINTF(message,"unexpected %s \"%s\" (%s)", \
>>                ((yychar<0)?"(?)":yytokname[YYTRANSLATE(yychar)]),     \
>>                (strlen(yytext)<48?yytext:"(?)"),x); \
>>       syntaxerror(line_nr,pos_nr,message);\
>>   }
>> #endif
> 
> Thus, the Bison-generated trailing semicolon looks like a separate 
> statement after your yyerror's closing brace.  That ends the `if' 
> construct.
> 
> I have another patch coming that will just happen to change this passage 
> of code in such a way that this won't be a problem anymore.  However, I'm 
> not sure when I'll get around to proposing it.
> 
> Regardless, it would be best if you changed yyerror to a function or at 
> least a function invocation.

Or use the traditional do { ... } while (0) trick.

Reply via email to