MdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().
MdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().

Replace the current NULL pointer dereference to retrieve Field's
offset with a call to OFFSET_OF().  This is implemented via
__builtin_offsetof for GCC and Clang, which eliminates UB caught by
Clang UndefinedBehaviorSanitizer.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <698b52c00dda40a38da3fa2eb3df3afebf936977@outlook.com>
Reviewed-by: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>

MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2