The standard I linked describes both the type signature, and also what the macro should
do. There are various ways that that can be implemented by the compiler, but assuming that you are using a compiler that meets the ANSI C standard, then the macro will behave as the standard says it should.
Using __builtin_offsetof is undefined, because it is not standardised. The fact that __builtin_offsetof is used to implement offsetof by GCC does not affect the fact that offsetof itself is standardised (in the same way that a given internal heap operation is not standardised, but might be used by GCC to implement malloc which is).