Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] rename p-exp.y's TRUE/FALSE
       [not found] <3DF217D9.57B25A10@iol.unh.edu>
@ 2002-12-09 12:45 ` David Carlton
  2002-12-09 12:51   ` Andrew Cagney
  2002-12-10  7:46   ` Pierre Muller
  0 siblings, 2 replies; 5+ messages in thread
From: David Carlton @ 2002-12-09 12:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: muller, bemis, clp

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"))
         {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] rename p-exp.y's TRUE/FALSE
  2002-12-09 12:45 ` [rfa] rename p-exp.y's TRUE/FALSE David Carlton
@ 2002-12-09 12:51   ` Andrew Cagney
  2002-12-09 13:15     ` David Carlton
  2002-12-10  7:46   ` Pierre Muller
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-12-09 12:51 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches, muller, bemis, clp

So that's the problem.

I'll push this up towards BFD, loosing true/false is one changing, 
`helpfully' defining TRUE/FALSE is a second.

(yes, approved)
Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] rename p-exp.y's TRUE/FALSE
  2002-12-09 12:51   ` Andrew Cagney
@ 2002-12-09 13:15     ` David Carlton
  0 siblings, 0 replies; 5+ messages in thread
From: David Carlton @ 2002-12-09 13:15 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches, muller, bemis, clp

On Mon, 09 Dec 2002 15:45:43 -0500, Andrew Cagney <ac131313@redhat.com> said:

> I'll push this up towards BFD, loosing true/false is one changing,
> `helpfully' defining TRUE/FALSE is a second.

Yah.  Especially since the defining is silent, so you might not even
be aware of the problem (as those of us using Bison in this situation
weren't):

  typedef int bfd_boolean;
  #undef FALSE
  #undef TRUE
  #define FALSE 0
  #define TRUE 1

Oh, for a world without #define...

> (yes, approved)

Thanks, committed.

David Carlton
carlton@math.stanford.edu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] rename p-exp.y's TRUE/FALSE
  2002-12-09 12:45 ` [rfa] rename p-exp.y's TRUE/FALSE David Carlton
  2002-12-09 12:51   ` Andrew Cagney
@ 2002-12-10  7:46   ` Pierre Muller
  2002-12-10  8:04     ` Andrew Cagney
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2002-12-10  7:46 UTC (permalink / raw)
  To: David Carlton, gdb-patches; +Cc: bemis, clp

At 21:37 09/12/2002, David Carlton wrote:
>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.

I prepared the similar patch yesterday
that used PASCAL_TRUE and PASCAL_FALSE
in analogy to the m2-exp.y file....
But I could not connect to sources.redhat.com 
yeterday. Was the machine down or was it just that there was no route
to it from where I am?

Anyhow, your patch is just as good as mine, so no need to change this.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rfa] rename p-exp.y's TRUE/FALSE
  2002-12-10  7:46   ` Pierre Muller
@ 2002-12-10  8:04     ` Andrew Cagney
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-12-10  8:04 UTC (permalink / raw)
  To: Pierre Muller; +Cc: David Carlton, gdb-patches, bemis, clp

> At 21:37 09/12/2002, David Carlton wrote:
> 
>>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.
> 
> 
> I prepared the similar patch yesterday
> that used PASCAL_TRUE and PASCAL_FALSE
> in analogy to the m2-exp.y file....
> But I could not connect to sources.redhat.com 
> yeterday. Was the machine down or was it just that there was no route
> to it from where I am?


Yes, there was an a outage :-(

Andrew



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-10 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3DF217D9.57B25A10@iol.unh.edu>
2002-12-09 12:45 ` [rfa] rename p-exp.y's TRUE/FALSE David Carlton
2002-12-09 12:51   ` Andrew Cagney
2002-12-09 13:15     ` David Carlton
2002-12-10  7:46   ` Pierre Muller
2002-12-10  8:04     ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox