Re: Another small error. Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Alexander Motin
On 23.11.2010 00:07, Artem Belevich wrote: While it's not directly related to hunting for '&'/'&&' typos, here's another seemingly wrong place in the code: --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -852,7 +852,7 @@ ahci_ch_attach(device_t dev) ch->caps = ctlr->caps;

Another small error. Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Artem Belevich
While it's not directly related to hunting for '&'/'&&' typos, here's another seemingly wrong place in the code: --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -852,7 +852,7 @@ ahci_ch_attach(device_t dev) ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; ch->quirks =

Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Bruce Cran
On Mon, 22 Nov 2010 10:48:09 -0800 Artem Belevich wrote: > hdr.elf.e_ident[EI_OSABI] is not a bitmask and '==' should've been > used instead. Now ldd.c has two instances of this bug due to > copy/pasting of orignal code. Fixed in r215705. Thanks! -- Bruce Cran __

Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Artem Belevich
There's another case of '&' used improperly. http://svn.freebsd.org/viewvc/base?view=revision&revision=90385 if (hdr.elf.e_ident[EI_OSABI] & ELFOSABI_FREEBSD) { is_shlib = 1; } else { hdr.elf.e_ident[EI_OSABI] is not a bitmask and '==' should've been used instead. Now ldd.c has

Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Alexander Best
On Mon Nov 22 10, Bruce Cran wrote: > I've been going through src/bin and src/sbin seeing how easy it would > be to remove warnings clang generates. During the work I came > across routed/parms.c which appears to be doing a logical instead of > bitwise AND. Would the following change be correct? l

Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Bruce Cran
I've been going through src/bin and src/sbin seeing how easy it would be to remove warnings clang generates. During the work I came across routed/parms.c which appears to be doing a logical instead of bitwise AND. Would the following change be correct? Index: /usr/src/head/sbin/routed/parms.c