Index: src/conv/vdeck/vdeck.c
===================================================================
--- src/conv/vdeck/vdeck.c	(revision 59089)
+++ src/conv/vdeck/vdeck.c	(working copy)
@@ -208,7 +208,7 @@
  * 'a' is the exact template expected by qsort.
  */
 static int
-sortFunc(const void *a, const void *b)
+sortFunc(const void *a, const void *b, void *UNUSED(arg))
 {
     const char **lhs = (const char **)a;
     const char **rhs = (const char **)b;
@@ -306,8 +306,8 @@
 		prompt(PROMPT);
 		continue;
 	    case SORT_TOC :
-		qsort((genptr_t)toc_list, (unsigned)ndir,
-		       sizeof(char *), sortFunc);
+		bu_sort((void *)toc_list, (unsigned)ndir,
+			sizeof(char *), sortFunc, NULL);
 		break;
 	    case TOC :
 		list_toc(arg_list);
Index: src/gtools/beset/beset.c
===================================================================
--- src/gtools/beset/beset.c	(revision 59089)
+++ src/gtools/beset/beset.c	(working copy)
@@ -52,7 +52,7 @@
 
 
 /* fitness of a given object compared to source */
-static int cmp_ind(const void *p1, const void *p2)
+static int cmp_ind(const void *p1, const void *p2, void *UNUSED(arg))
 {
     if (((struct individual *)p2)->fitness > ((struct individual *)p1)->fitness)
 	return -1;
@@ -168,7 +168,7 @@
 	    total_fitness += FITNESS;
 	}
 	/* sort population - used for keeping top N and dropping bottom M */
-	qsort(pop.parent, pop.size, sizeof(struct individual), cmp_ind);
+	bu_sort((void *)pop.parent, pop.size, sizeof(struct individual), cmp_ind, NULL);
 
 	/* remove lower M of individuals */
 	for (i = 0; i < opts.kill_lower; i++) {
Index: src/libbn/chull.c
===================================================================
--- src/libbn/chull.c	(revision 59089)
+++ src/libbn/chull.c	(working copy)
@@ -97,7 +97,7 @@
 
 /* QSort functions for points */
 HIDDEN int
-pnt_compare_2d(const void *pnt1, const void *pnt2)
+pnt_compare_2d(const void *pnt1, const void *pnt2, void *UNUSED(arg))
 {
     point2d_t *p1 = (point2d_t *)pnt1;
     point2d_t *p2 = (point2d_t *)pnt2;
@@ -124,7 +124,7 @@
 	V2MOVE(points[i], points_2d[i]);
     }
 
-    qsort((genptr_t)points, n, sizeof(point2d_t), pnt_compare_2d);
+    bu_sort((void *)points, n, sizeof(point2d_t), pnt_compare_2d, NULL);
 
     /* Once sorted, the points can be viewed as describing a simple polyline
      * and the Melkman algorithm works for a simple polyline even if it
Index: src/libged/edcodes.c
===================================================================
--- src/libged/edcodes.c	(revision 59089)
+++ src/libged/edcodes.c	(working copy)
@@ -39,7 +39,7 @@
 
 
 HIDDEN int
-edcodes_id_compare(const void *p1, const void *p2)
+edcodes_id_compare(const void *p1, const void *p2, void *UNUSED(arg))
 {
     int id1, id2;
 
@@ -51,7 +51,7 @@
 
 
 HIDDEN int
-edcodes_reg_compare(const void *p1, const void *p2)
+edcodes_reg_compare(const void *p1, const void *p2, void *UNUSED(arg))
 {
     char *reg1, *reg2;
 
@@ -260,9 +260,9 @@
 
 	/* sort the array of lines */
 	if (sort_by_ident) {
-	    qsort(line_array, line_count, sizeof(char *), edcodes_id_compare);
+	    bu_sort((void *)line_array, line_count, sizeof(char *), edcodes_id_compare, NULL);
 	} else {
-	    qsort(line_array, line_count, sizeof(char *), edcodes_reg_compare);
+	    bu_sort((void *)line_array, line_count, sizeof(char *), edcodes_reg_compare, NULL);
 	}
 
 	/* rewrite the temp file using the sorted lines */
Index: src/libged/wdb_obj.c
===================================================================
--- src/libged/wdb_obj.c	(revision 59089)
+++ src/libged/wdb_obj.c	(working copy)
@@ -193,7 +193,7 @@
  * on the respective names and return that value.
  */
 int
-wdb_cmpdirname(const genptr_t a, const genptr_t b)
+wdb_cmpdirname(const void *a, const void *b, void *UNUSED(arg))
 {
     struct directory **dp1, **dp2;
 
@@ -271,9 +271,9 @@
     int cwidth;		/* column width */
     int numcol;		/* number of columns */
 
-    qsort((genptr_t)list_of_names,
-	  (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
-	  (int (*)(const void *, const void *))wdb_cmpdirname);
+    bu_sort((void *)list_of_names,
+	    (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
+	    wdb_cmpdirname, NULL);
 
     /*
      * Traverse the list of names, find the longest name and set the
@@ -363,9 +363,9 @@
     int max_type_len = 0;
     struct directory *dp;
 
-    qsort((genptr_t)list_of_names,
-	  (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
-	  (int (*)(const void *, const void *))wdb_cmpdirname);
+    bu_sort((void *)list_of_names,
+	    (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
+	    wdb_cmpdirname, NULL);
 
     for (i = 0; i < num_in_list; i++) {
 	int len;
@@ -485,9 +485,9 @@
     int isComb, isRegion;
     int isSolid;
 
-    qsort((genptr_t)list_of_names,
-	  (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
-	  (int (*)(const void *, const void *))wdb_cmpdirname);
+    bu_sort((void *)list_of_names,
+	    (unsigned)num_in_list, (unsigned)sizeof(struct directory *),
+	    wdb_cmpdirname, NULL);
 
     /*
      * i - tracks the list item
