Paul Eggert <egg...@cs.ucla.edu> wrote: > On 4/6/22 01:24, arn...@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.
Thanks, Arnold