[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: string token
From: |
Xinan Tang |
Subject: |
RE: string token |
Date: |
Wed, 3 Dec 2003 00:22:47 +0100 |
Hi Hans,
$1 will be overwritten by $2 when printf is executed. One has to copy
$1 somewhere as soon as yyval is available.
--Xinan
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Hans
Aberg
Sent: Tuesday, December 02, 2003 11:52 AM
To: Nosnos
Cc: address@hidden
Subject: Re: string token
In your C printf statement, you use the token numbers as format strings,
and no output data, so the effect is undefined according to the C
standard.
So it is a question of writing correct C code, not a Help-Bison problem.
You might try an action like
printf("...%s...%s...", $1, $2);
or
printf("...%s...%s...", $1.string, $2.string);
depending on whether %union is used or not.
Hans Aberg
_______________________________________________
address@hidden http://mail.gnu.org/mailman/listinfo/help-bison