summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/include/endian.h9
1 files changed, 8 insertions, 1 deletions
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)