Is dereferencing a pointer that's equal to nullptr undefined behavior by the standard?
A blog author has brought up the discussion about null pointer dereferencing. I've put some counter arguments here. His main line of reasoning quoting the standard is this: The '&podhd->line6' expression is undefined behavior in the C language when 'podhd' is a null pointer. The C99 standard says the following about the '&' address-of operator (6.5.3.2 "Address and indirection operators"): The operand of the unary & operator shall be either a function designator, the result of a [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is not declared with the
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.