9 compare (const void *p1
, const void *p2
)
12 int n
= backtrace (ba
, sizeof (ba
) / sizeof (ba
[0]));
15 char **names
= backtrace_symbols (ba
, n
);
19 printf ("called from %s\n", names
[0]);
20 for (i
= 1; i
< n
; ++i
)
21 printf (" %s\n", names
[i
]);
26 return *(const uint32_t *) p1
- *(const uint32_t *) p2
;
31 main (int argc
, char *argv
[])
36 for (cnt
= 0; cnt
< sizeof (arr
) / sizeof (arr
[0]); ++cnt
)
39 qsort (arr
, sizeof (arr
) / sizeof (arr
[0]), sizeof (arr
[0]), compare
);
41 for (cnt
= 0; cnt
< sizeof (arr
) / sizeof (arr
[0]); ++cnt
)
42 printf ("%" PRIx32
"\n", arr
[cnt
]);