diff options
-rw-r--r-- | sys/arch/alpha/include/endian.h | 9 | ||||
-rw-r--r-- | sys/arch/arc/include/endian.h | 9 | ||||
-rw-r--r-- | sys/arch/m68k/include/endian.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/endian.h | 9 | ||||
-rw-r--r-- | sys/arch/pmax/include/endian.h | 7 | ||||
-rw-r--r-- | sys/arch/wgrisc/include/endian.h | 9 |
6 files changed, 47 insertions, 5 deletions
diff --git a/sys/arch/alpha/include/endian.h b/sys/arch/alpha/include/endian.h index 5c4a852c700..5ab601f97fd 100644 --- a/sys/arch/alpha/include/endian.h +++ b/sys/arch/alpha/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.5 1997/06/25 12:32:48 downsj Exp $ */ +/* $OpenBSD: endian.h,v 1.6 1997/06/25 12:52:07 grr Exp $ */ /* $NetBSD: endian.h,v 1.3 1996/10/13 19:57:59 cgd Exp $ */ /* @@ -70,6 +70,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) diff --git a/sys/arch/arc/include/endian.h b/sys/arch/arc/include/endian.h index d893b4c6a15..2bae3bd2a1c 100644 --- a/sys/arch/arc/include/endian.h +++ b/sys/arch/arc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.4 1997/06/25 12:32:49 downsj Exp $ */ +/* $OpenBSD: endian.h,v 1.5 1997/06/25 12:52:08 grr Exp $ */ /* $NetBSD: endian.h,v 1.4 1994/10/26 21:09:38 cgd Exp $ */ /* @@ -75,6 +75,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) diff --git a/sys/arch/m68k/include/endian.h b/sys/arch/m68k/include/endian.h index 02875635f86..b9514134c68 100644 --- a/sys/arch/m68k/include/endian.h +++ b/sys/arch/m68k/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.7 1997/06/25 12:32:50 downsj Exp $ */ +/* $OpenBSD: endian.h,v 1.8 1997/06/25 12:52:09 grr Exp $ */ /* $NetBSD: endian.h,v 1.10 1996/10/13 02:59:55 christos Exp $ */ /* @@ -139,6 +139,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #define ntohl(x) betoh32(x) #define ntohs(x) betoh16(x) diff --git a/sys/arch/mvme88k/include/endian.h b/sys/arch/mvme88k/include/endian.h index c53407aa1db..5fa99cefc7a 100644 --- a/sys/arch/mvme88k/include/endian.h +++ b/sys/arch/mvme88k/include/endian.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)endian.h 8.1 (Berkeley) 6/11/93 - * $Id: endian.h,v 1.6 1997/06/25 12:32:51 downsj Exp $ + * $Id: endian.h,v 1.7 1997/06/25 12:52:10 grr Exp $ */ #ifndef _ENDIAN_H_ @@ -69,6 +69,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) diff --git a/sys/arch/pmax/include/endian.h b/sys/arch/pmax/include/endian.h index c2957e659fc..60cac2a0a72 100644 --- a/sys/arch/pmax/include/endian.h +++ b/sys/arch/pmax/include/endian.h @@ -75,6 +75,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) diff --git a/sys/arch/wgrisc/include/endian.h b/sys/arch/wgrisc/include/endian.h index 1ec9259725a..b8899c077cf 100644 --- a/sys/arch/wgrisc/include/endian.h +++ b/sys/arch/wgrisc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.3 1997/06/25 12:32:54 downsj Exp $ */ +/* $OpenBSD: endian.h,v 1.4 1997/06/25 12:52:11 grr Exp $ */ /* $NetBSD: endian.h,v 1.4 1994/10/26 21:09:38 cgd Exp $ */ /* @@ -75,6 +75,13 @@ __END_DECLS /* * Macros for network/external number representation conversion. + * + * The way this works is that HTONS(x) modifies x and *can't* be used as + * and rvalue i.e. foo=HTONS(bar) is wrong. Likewise x=htons(x) should + * never be used where HTONS(x) will serve i.e. foo=htons(foo) is wrong. + * Failing to observe these rule will result in code that appears to work + * and probably does work, but generates gcc warnings on architectures + * where the macros are used to optimize away an unneeded conversion. */ #if BYTE_ORDER == BIG_ENDIAN && !defined(lint) #define ntohl(x) (x) |