This question will draw information from the draft N1570, so C11 basically.
Colloquially, to dereference a pointer means to apply the unary *
operator to a pointer. There is only one place where the word "dereferencing" exists in the draft document (no instance of "dereference"), and it is in a footnote:
102) [...]
Among the invalid values for dereferencing a pointer by the unary
*
operator are a null pointer, an address inappropriately aligned for the type of object pointed to, and the address of an object after the end of its lifetime
As far as I can see, the unary *
operator is actually called the "indirection operator", as evidenced by §6.5.3.2:
6.5.3.2 Address and indirection operators
4
The unary*
operator denotes indirection. [...]
Simiarily, it is explicitly called the indirection operator in Annex §J.2:
— The value of an object is accessed by an array-subscript
[]
, member-access.
or−>
, address&
, or indirection*
operator or a pointer cast in creating an address constant (6.6).
So is it correct to talk about "dereferencing pointers" in C or is this being excessively pedantic? Where does the terminology come from? (I can kinda give a pass on []
being called "deferencing" due to §6.5.2.1)
Kernighan and Ritchie, The C Programming Language, 2nd ed., 5.1: