Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: HEAD building fails on ubuntu 9.10
On Sun, 18 Apr 2010, Piotr Meyer wrote:
> On Sun, Apr 18, 2010 at 11:40:07AM +0200, Alan Barrett wrote:
> > > /usr/src/lib/libc/string/swab.c(69): warning: bitwise operation on
> > > signed value possibly nonportable [117]
> 
> I got same message witch swab.c 1.15. Native build on -current (5.99.25).
The only bitwise operations I see are in lines 65 and 67, not line
69, so this is confusing.
Anyway, I see three simple solutions:
  1) change the type of len back to size_t;
  2) use arithmetic instead of bitwise operations (e.g. len % 8
     instead of len & 7, and len /= 8 instead of len >>= 3);
  3) make an unsigned copy of len, and carry on doing bitwise operations
     but using the copy instead of the original.
My preferred solution is 1 (make the type of len size_t).  Revision
1.16 of swab.c implements solution 2.
--apb (Alan Barrett)
Home |
Main Index |
Thread Index |
Old Index