I know about a feature, when we can get an offset of struct member via NULL or invalid pointer, like here:
#include<stdlib.h>
#include<stdio.h>
typedef struct  A {
        int c;
        int b;
} A;
int main() {
        A *a = (A*)0x100;
        fprintf(stderr, "%p\n", &((*a).b));
        fprintf(stderr, "%p\n", &a->b);
}
This program produces:
0x104
0x104
Is there a way to disable this feature and get a segfault or error instead?
 
     
    