This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa] rename p-exp.y's TRUE/FALSE
- From: David Carlton <carlton at math dot stanford dot edu>
- To: gdb-patches at sources dot redhat dot com
- Cc: muller at sources dot redhat dot com, bemis <bemis at iol dot unh dot edu>, clp <clp at iol dot unh dot edu>
- Date: 09 Dec 2002 12:37:00 -0800
- Subject: [rfa] rename p-exp.y's TRUE/FALSE
- References: <3DF217D9.57B25A10@iol.unh.edu>
In p-exp.y there are tokens TRUE and FALSE; a recent change to bfd.h
also created defines named TRUE and FALSE. This might cause silent
problems and one user has reported that this causes actual compilation
problems (it depends on which order the defines happen in).
This patch renames the tokens to TRUEKEYWORD and FALSEKEYWORD,
following the lead of c-exp.y.
Okay to commit?
David Carlton
carlton@math.stanford.edu
2002-12-09 David Carlton <carlton@math.stanford.edu>
* p-exp.y: Rename TRUE and FALSE to TRUEKEYWORD and FALSEKEYWORD.
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.20
diff -u -p -r1.20 p-exp.y
--- p-exp.y 30 Nov 2002 16:33:55 -0000 1.20
+++ p-exp.y 9 Dec 2002 20:12:22 -0000
@@ -205,7 +205,7 @@ static int search_field;
/* Object pascal */
%token THIS
-%token <lval> TRUE FALSE
+%token <lval> TRUEKEYWORD FALSEKEYWORD
%left ','
%left ABOVE_COMMA
@@ -434,13 +434,13 @@ exp : exp ASSIGN exp
{ write_exp_elt_opcode (BINOP_ASSIGN); }
;
-exp : TRUE
+exp : TRUEKEYWORD
{ write_exp_elt_opcode (OP_BOOL);
write_exp_elt_longcst ((LONGEST) $1);
write_exp_elt_opcode (OP_BOOL); }
;
-exp : FALSE
+exp : FALSEKEYWORD
{ write_exp_elt_opcode (OP_BOOL);
write_exp_elt_longcst ((LONGEST) $1);
write_exp_elt_opcode (OP_BOOL); }
@@ -1379,14 +1379,14 @@ yylex ()
if (STREQ (uptokstart, "FALSE"))
{
yylval.lval = 0;
- return FALSE;
+ return FALSEKEYWORD;
}
break;
case 4:
if (STREQ (uptokstart, "TRUE"))
{
yylval.lval = 1;
- return TRUE;
+ return TRUEKEYWORD;
}
if (STREQ (uptokstart, "SELF"))
{