[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Using tinycc for full source bootstrapping

From: Larry Doolittle
Subject: Re: [Tinycc-devel] Using tinycc for full source bootstrapping
Date: Sun, 24 Sep 2017 13:17:05 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Friends -

On Sun, Sep 24, 2017 at 12:27:17PM -0700, Larry Doolittle wrote:
> On Sun, Sep 24, 2017 at 09:48:25AM +0200, Jan Nieuwenhuizen wrote:
> > -    p[0] = x & 255, p[1] = x >> 8 & 255;
> The original line above, however, screams "I am a bug" to me.
> The return value of "x & 255" is ignored, and it has no side effects,
> so it can be discarded, leaving
>    p[0] = p[1] = x >> 8 & 255;
> Is there any evidence it works?

I tested it, and it does in fact work.  Sorry, I got a little mixed up
on the order of operations.

Still, using comma there instead of semicolon seems needlessly confusing.
It suggests that these were once tricky macro expansions instead
of inline functions.  If it were me I would use semicolon there
(write32le()) and in write64le().

   - Larry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]