I was reading the source code for a NES assembler written in pre-C99 C, and there was an odd C feature used in it that I haven't really seen anywhere else. It was before C had built-in booleans and the author had defined their own, but true was: void * true_ptr = &true_ptr; true_ptr is a pointer to itself. So however many times you deference it: printf("%p\n", true_ptr); printf("%p\n", &true_ptr); printf("%p\n", *((v…
cdecl> explain const void * const_pointer
declare const_pointer as pointer to const void
cdecl> explain void * const const_value
declare const_value as const pointer to void
cdecl>
The first must be the one that segfaults on write, IFF the compiler chooses to place it in the .text (as it should).