"Michael N. Moran" <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > "Michael N. Moran" <[EMAIL PROTECTED]> writes: | > | Wow. I'm sure there is sound reasoning for this ... but I can't | > | understand what that might be given a client module could intentionally | > | (if ill-adviseadly) simply invoke the function: | > then it gets what it deserves. Check out GCC manual for null-pointer | > check. | | From info gcc: | | `-fdelete-null-pointer-checks' | Use global dataflow analysis to identify and eliminate useless | checks for null pointers. The compiler assumes that dereferencing | a null pointer would have halted the program. If a pointer is | checked after it has already been dereferenced, it cannot be null. | | The second sentence makes me question the difference between an | actual dereferencing operation and the use of a dereferencing | operator used to convert a pointer to a C++ reference. Clearly | (to me anyway ;-) the conversion case does not actually cause | an access to the object.
It is not a conversion. It is a dereference operation that is defined only for non-null operand. No ifs, no buts. -- Gaby