[Top][All Lists]

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

Re: gawk-5.1.1 bug report

From: arnold
Subject: Re: gawk-5.1.1 bug report
Date: Wed, 06 Apr 2022 11:05:26 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Paul Eggert <eggert@cs.ucla.edu> wrote:

> On 4/6/22 01:24, arnold@skeeve.com wrote:
> > Most people
> > would wonder "Why is there a bitwise and here?" and not think of it
> > as a logical and.
> I'm not sure I agree about the "most", as I expect most people won't 
> notice or care about this level of detail. However, for people who 
> wonder like that, about adding an explanatory comment? That will help 
> people who are unaccustomed to this valid and useful (albeit 
> less-common) programming style. Something like the attached (untested) 
> patch, perhaps?
> > & for a logical test can be dangerous since any non-zero
> > value can be true.
> Sure, but that's an issue only when using & on types like 'int'. It's 
> not an issue when using & on 'bool'. Similarly, + has rounding issues on 
> 'float' but that doesn't mean we need to worry about +'s rounding issues 
> on 'int'.
I don't care for the diff. It's a lot more work than changing & to &&,
but as I have my own copy of dfa.c I won't worry about it.



reply via email to

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