...and you'd also get a typecasting error (from int to int *).
No you wouldn't. It's one of the optional arguments, so a plain ANSI C compiler will just take its type at face value (after doing some promotions like char,short->int and float->double). GCC will warn if you want, because it knows how scanf and similar functions are supposed to work. However, it won't do any conversions; it would be violating the ANSI C standard if it did.
Don't worry guys, I didn't get it straight away either. I had to read the note too.
OK, here's the deal. scanf is NOT called; all that happens is the code takes a pointer to scanf. When you get a comma, the left-hand expression is evaluated first and discarded (useful if it has a side-effect), and then the right-hand expression is evaluated. The whole expression has the value of the right-hand subexpression. Likewise, the "%d" (actually a pointer to such a string stored in read-only memory) is discarded, and the i is returned.
So, give or take a couple of 'left-hand blah of comma has no effect' warnings (not an accurate quote ), it compiles and does exactly what it says on the tin.