According to the standard, extern inline functions must the same address in all translation units.
How is this achieved in the compiler? I mean when I’m compiling some translation unit, I have no idea what the other TU will be like. So how can I have the same address everywhere?
That’s up to the implementation, but usually it’s resolved by the linker. Each compiled translation unit will produce an object file containing a copy of the function, flagged in some way so that the linker knows that it should expect (and accept) duplicates. The linker will include one of them, discard the others, and resolve any references to the function.