This test looks odd.  `'...'` character literal actually expand to a number, so in what situation can `n` be greater than `n+1` -- and same for `+1` vs `+2`?  If you *really* want to make sure that `'9' + 1` won't overflow, juts use `gint` instead of `gchar` as the type for `d` and cast it upon assignment since you never actually want the value of `'9' + 1` anyway.

Anyway, I feel like this test makes things way harder to understand without any practical benefit (why do you test this, and moreover, why also testing the `+2` also didn't feel straightforward, I had to really try to understand what was going on).

And also, I don't think that it's our worse problem if we don't have an ASCII-compatible libc charset anyway.  In which case, you could also try if `'0' < '1' < '2' < '3' < '4' < '5' < '6' < '7' < '8' < '9'`, why would this be the case.