Package: libc6-dev
Version: 2.1.3-8

This is a tricky one.  I think it's important, because
without it, any code that uses ntohl gets silly warnings.

When compiling the following code, using 
"gcc -O2 -Wtraditional tester.c"
I get the following warning.

The Warning:
---
tester.c: In function `main':
tester.c:4: warning: integer constant is unsigned in ANSI C, signed with 
-traditional

The Code:
---
int main() {
  unsigned int h = ntohl(12);
  return(h);
}

The Fix:
---
/usr/include/bits/byteswap.h, line 48:

/* Swap bytes in 32 bit value.  */
#define __bswap_constant_32(x) \
     ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |         \
      (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))

should be changed to:
     ((((x) & 0xff000000U) >> 24) {etc.}

This macro seems to be the ultimate expansion of ntohl, and
causes the warning.  It's not clear to me that the change
to force that to be unsigned won't cause some other error.

other stuff:
uname: Linux poplar 2.2.13 #1 Sat Nov 20 12:44:19 EST 1999 i686 unknown
libc6: /lib/libc.so.6 -> libc-2.1.3.so

thanks,
-neil

Reply via email to