// Error: un comparador que resta. La resta puede no caber en un int.
#include <limits.h>
#include <stdio.h>

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

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

int main(void) {
    int low = INT_MIN;
    int one = 1;
    printf("con resta: %d\n", compare_by_subtracting(&low, &one));
    printf("sin resta: %d\n", compare_safely(&low, &one));
    return 0;
}
