Menu

#18 evlib doesn't build on Debian ppc64 - tmplgram.y

v1.4.0
open
8
2003-04-02
2003-04-02
No

The template grammar, lib/template/tmplgram.y, blurs the int/long distinction in a few places. The result
is that on ppc64, Debian's yacc fails with "type clashes" at the importStmt and optionalInt rules.

Part of the solution is to change
unsigned long ival;
to
int ival;
unsigned long ulval;
and
%type <ival> TK_INTEGER
...
%type <ival> integerConstant
to
%type <ulval> TK_INTEGER
...
%type <ulval> integerConstant

We also need to clean up rules involving integerConstant -- facilityStmt, dimensionSpec, bitField. For
facilityStmt, what we want to return is really a posix_log_facility_t (unsigned int), so we should probably
introduce a new %union member for that. For the other two, it should be sufficient to cast the
integerConstant to an int.

Also, for the eventTypeStmt rule, we need to cast the signedIntegerConstant down to an int.

Finally, we need to check for similar problems in the query grammar, lib/query/query.y.

Discussion


Log in to post a comment.