That rule was added in the 1999 version of the C standard. In C90, the status returned is undefined.
You can enable it by passing -std=c99
to gcc.
As a side note, interestingly 9 is returned because it’s the return of printf
which just wrote 9 characters.