Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177883894
D52502.1795510804.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D52502.1795510804.diff
View Options
diff --git a/lib/libc/tests/string/memcmp_test.c b/lib/libc/tests/string/memcmp_test.c
--- a/lib/libc/tests/string/memcmp_test.c
+++ b/lib/libc/tests/string/memcmp_test.c
@@ -41,14 +41,14 @@
#endif
/*
- * On FreeBSD we demand that memcmp returns the difference between the
- * characters at the first site of mismatch. However, ISO/IEC 9899:1990
- * only specifies that a number greater than, equal to, or less than
- * zero shall be returned. If a unit test for this less strict
- * behaviour is desired, define RES(x) to be (((x) > 0) - ((x) < 0)).
+ * On FreeBSD we previously demanded that memcmp returns the difference
+ * between the characters at the first site of mismatch. However,
+ * ISO/IEC 9899:1990 only specifies that a number greater than, equal
+ * to, or less than zero shall be returned. If a unit test for the
+ * more strict behaviour is desired, define RES(x) to be (x).
*/
#ifndef RES
-#define RES(x) (x)
+#define RES(x) (((x) > 0) - ((x) < 0))
#endif
static int (*memcmp_fn)(const void *, const void *, size_t);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 9:00 AM (9 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41951296
Default Alt Text
D52502.1795510804.diff (1 KB)
Attached To
Mode
D52502: libc: Have memcmp test what's actually required by the standard
Attached
Detach File
Event Timeline