From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoann Padioleau To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Fri, 17 Oct 2014 17:48:46 +0000 Message-ID: References: In-Reply-To: Content-Type: multipart/alternative; boundary="_000_F8114E49B8EF4D748BDB15B99BEB97E9fbcom_" MIME-Version: 1.0 Subject: Re: [9fans] copy paste bug in cc.y? Topicbox-Message-UUID: 1d6c4eb4-ead9-11e9-9d60-3106f5b1d025 --_000_F8114E49B8EF4D748BDB15B99BEB97E9fbcom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Somehow? Would be nice to have a comment explaining this =93somehow" then because it looks tricky. Also is there a place explaining the naming conventions? I have a hard time understanding what is the difference between tcom(), acom(), xcom(), and then there=92s complex() =85 On Oct 14, 2014, at 5:50 PM, Rob Pike > wrote: It's not dead code. It's prepping the switch somehow. -rob On Tue, Oct 14, 2014 at 3:45 PM, Rob Pike > wrote: Looks like it. -rob On Tue, Oct 14, 2014 at 3:11 PM, Yoann Padioleau > wrote: Hi, It=92s a copy paste bug here right? https://code.google.com/p/ken-cc/source/browse/src/cmd/cc/cc.y#476 | LSWITCH '(' cexpr ')' stmnt { $$ =3D new(OCONST, Z, Z); $$->vconst =3D 0; $$->type =3D types[TINT]; $3 =3D new(OSUB, $$, $3); $$ =3D new(OCONST, Z, Z); $$->vconst =3D 0; $$->type =3D types[TINT]; $3 =3D new(OSUB, $$, $3); $$ =3D new(OSWITCH, $3, $5); } --_000_F8114E49B8EF4D748BDB15B99BEB97E9fbcom_ Content-Type: text/html; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable Somehow?

Would be nice to have a comment explaining this =93somehow" then<= /div>
because it looks tricky.

Also is there a place explaining the naming conventions?
I have a hard time understanding what is the difference
between tcom(), acom(), xcom(), and then there=92s  complex() =85=


On Oct 14, 2014, at 5:50 PM, Rob Pike <robpike@gmail.com> wrote:

It's not dead code. It's prepping the switch somehow.

-rob


On Tue, Oct 14, 2014 at 3:45 PM, Rob Pike <robpike@gmail.co= m> wrote:
Looks like it.

-rob


On Tue, Oct 14, 2014 at 3:11 PM, Yoann Padioleau= <pad@fb.com> wrote:
Hi,

It=92s a copy paste bug here right?


|       LS= WITCH '(' cexpr ')' stmnt
        {
                $$ =3D new(OCONST, Z, Z);
                $$->vconst =3D 0= ;
                $$->type =3D types[TINT];
                $3 =3D new(OSUB, $$, $3);

                $$ =3D new(OCONST, Z, Z);
                $$->vconst =3D 0= ;
                $$->type =3D types[TINT];
                $3 =3D new(OSUB, $$, $3);

                $$ =3D new(OSWITCH, $3, $5);
        }





--_000_F8114E49B8EF4D748BDB15B99BEB97E9fbcom_--