qsort shall not be used and no macro with one of these names shall be expanded.
These two functions take as arguments a caller-defined comparison function. If the comparison function does not behave consistently when comparing
elements, or if it modifies any of the elements, the behavior is undefined.
Note: the unspecified behavior, which relates to the treatment of elements that compare as equal, can be avoided by ensuring that the comparison
function never returns 0. When two elements are otherwise equal, the comparison function could return a value that indicates their relative order in
the initial array.
Further, the implementation of
qsort is likely to be recursive and will therefore place unknown demands on stack resources. This is of
concern in embedded systems because the stack is likely to have a fixed, often small, size.
- MISRA C:2012, 21.9 - The library functions
<stdlib.h> shall not be used.