|
From: | Eric Weddington |
Subject: | Re: [avrdude-dev] avrdude on Solaris 10 x86? |
Date: | Wed, 02 Nov 2005 14:08:04 -0700 |
User-agent: | Mozilla Thunderbird 1.0.2 (Windows/20050317) |
Joerg Wunsch wrote:
That's a quite nasty problem. Their yacc generates the following code: #define YYMAXDEPTH 150 ... YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv; Looks all quite fine, doesn't it?
yyyes. :-)
There's a damn pitfall in that. config.h actually #defines YYSTYPE: #if !defined(HAS_YYSTYPE) #define YYSTYPE struct token_t * #endif So the above will eventually evaluate to struct token_t * yy_yyv[150], *yyv = yy_yyv; Obviously, their idea to merge two declarations into a single one hitsbadly here.
Blech. That's just one of the reasons that style of programming should never be done.
OK, I cheated. I added a typedef struct token_t *token_p; to config.h, and changed the #define to #define YYSTYPE token_p That way, it works as intented for all parser generators: Solaris yacc, Berkeley yacc, and GNU bison.
w00t! Thanks for taking a look at this! -- Eric Weddington
[Prev in Thread] | Current Thread | [Next in Thread] |