Spot the bug in the qsort comparator

from C function pointers
C23 (GCC 13.3.0) intermediate 4 min 1 issue to find

Find the correctness bug in this qsort comparator.

C
typedef struct {
    int priority;
} Job;

int compare_jobs(const void *lhs, const void *rhs) {
    const Job *left = lhs;
    const Job *right = rhs;
    return left->priority - right->priority;
}
Open in playground
Report an error