@aescling Can't find my thread from a few hours ago right now, but regarding NULL, I just spotted this sentence in the C89 standard:
An integral constant expression with the value 0, or such an expression cast to type void * , is called a null pointer constant. If a null pointer constant is assigned to or compared for equality to a pointer, the constant is converted to a pointer of that type. Such a pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function.
So combined with
NULL, which expands to an implementation-defined null pointer constant
So it actually does say that NULL is always just 0 or (void*)0!
Would be really weird if it didn't, but somehow I missed the first part and was extremely confused about why it's implementation-defined...
@vaporeon_ @aescling i think i've seen cursed compiler settings that let you define NULL to be a different address so that you can access address 0 normally, but they might be technically non-compliant
@vaporeon_ @aescling i have no idea what it's used for practically, i thiiiiiink i saw it in a video about "how deep can you recurse" where they were abusing a bunch of hacks to recurse extremely deep in C but i might be mistaken
@monorail @vaporeon_ 99% i like things done safely and paranoidly. but that kind of thing is the 1% of the time where you gotta let the stupid ridiculous bullshit fly and i love it