// Error: qsort con un comparador que resta, sobre datos que hacen overflow.
#include <stdio.h>
#include <stdlib.h>

#define COUNT 5

int compare_by_subtracting(const void *first, const void *second) {
    int a = *(const int *) first;
    int b = *(const int *) second;
    return a - b;
}

int main(void) {
    int values[COUNT] = {2000000000, -2000000000, 5, 1500000000, -1500000000};
    qsort(values, COUNT, sizeof(values[0]), compare_by_subtracting);
    for (int i = 0; i < COUNT; i++) {
        printf("%d\n", values[i]);
    }
    return 0;
}
