Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157030831
D31292.id92691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31292.id92691.diff
View Options
Index: lib/libc/stdlib/Makefile.inc
===================================================================
--- lib/libc/stdlib/Makefile.inc
+++ lib/libc/stdlib/Makefile.inc
@@ -18,6 +18,8 @@
strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
+CFLAGS.qsort.c+= -Wsign-compare
+
# Work around an issue on case-insensitive file systems.
# libc has both _Exit.c and _exit.s and they both yield
# _exit.o (case insensitively speaking).
Index: lib/libc/stdlib/qsort.c
===================================================================
--- lib/libc/stdlib/qsort.c
+++ lib/libc/stdlib/qsort.c
@@ -36,6 +36,7 @@
__FBSDID("$FreeBSD$");
#include <errno.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -171,7 +172,7 @@
pn = (char *)a + n * es;
d1 = MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - d1, d1);
- d1 = MIN(pd - pc, pn - pd - es);
+ d1 = MIN(pd - pc, pn - pd - (ptrdiff_t)es);
vecswap(pb, pn - d1, d1);
d1 = pb - pa;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 1:14 AM (17 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33282326
Default Alt Text
D31292.id92691.diff (1 KB)
Attached To
Mode
D31292: libc qsort(3): Eliminate ambiguous sign comparison
Attached
Detach File
Event Timeline
Log In to Comment