3 ms·
> compiler developers have started feeling justified in saying "if (&myref == NULL)" is nonsense they can "optimize out" (as if I somehow typed that by mistake
by saagarjha 8y ago
> compiler developers have started feeling justified in saying "if (&myref == NULL)" is nonsense they can "optimize out" (as if I somehow typed that by mistake :/...); but that is just the compiler making an unwarranted and clearly incorrect "assumption": nothing in any of the language standard, the compiler, or the runtime "guarantees" that references point at something
I don't see how there is nothing guaranteeing that your references are nonnull. My understanding was that the standard prevents you from having a null reference because the methods of trying to generate one are codified as illegal or performing undefined behavior. Am I wrong here, or misunderstanding what you're trying to say?