(redirected from dereferences)


To access the thing to which a pointer points, i.e. to follow the pointer. E.g. in C, the declarations

int i; int *p = &i;

declare i as an integer and p as a pointer to integer. p is initialised to point at i ("&i" is the address of i - the inverse of "*"). The expression *p dereferences p to yield i as an lvalue, i.e. something which can appear either on the left of an assignment or anywhere an integer expression is valid. Thus

*p = 17;

would set i to 17. *p++ is not the same as i++ however since it is parsed as *(p++), i.e. increment p (which would be an invalid thing to do if it was pointing to a single int, as in this example) then dereference p's old value.

The C operator "->" also dereferences its left hand argument which is assumed to point to a structure or union of which the right hand argument is a member.

At first sight the word "dereference" might be thought to mean "to cause to stop referring" but its meaning is well established in jargon.


To go to an address before performing the operation. For example, in C programming, a dereferenced variable is a pointer to the variable, not the variable itself. The expression int Num; declares an integer variable named "Num." The expression *pNum = &Num; places the address of the variable Num (not its contents) into the pointer. The ampersand is the "address of" operator.

Another example is found in the tar archiving program. The dereference switch causes files referenced by symbolic links to be archived rather than the symbolic link itself. The term always refers to "following the link" in order to obtain the intended resource. See symbolic link.
References in periodicals archive ?
Additionally, analysis of the results of the big data projects found that contributors are fixing more critical issues, like resource leaks, null pointer dereferences and concurrent data access violations.
The service is designed to find the most common and critical issues in Java code bases, including resource leaks, race conditions, concurrency issues, control flow issues, null pointer dereferences, issues detected by the open source FindBugs tool, copy and paste errors, and many other software defects resulting in incorrect or unpredictable program behavior.
After locating the URI of a resource, the LOD retrieval process dereferences that URI at the DBpedia server to get the respective resource RDF description.
a physical resource whose metadata is recorded in the system); in this situation it cannot be associated with a true URL which dereferences it.
In spite of the safeguards of garbage collection, strong type checking and run-time checking of array bounds and object dereferences, Java applications are still released with numerous defects," said Jeff Klagenberg, Reasoning director of product development.
It pinpoints null pointer dereferences, memory leaks, out-of-bounds array accesses, uninitialized variables, and bad deallocations in C and C++ code and, because it does not rely on test cases, allows complete code coverage.
Since last year's Coverity Scan Project Spotlight, the LibreOffice team analyzed more than 9 million lines of code to find and fix more than 6,000 defects C including high- and medium-impact defects like null pointer dereferences, resource leaks and error handling issues.
The class will also cover the types of software defects found through inspection techniques, such as null pointer dereferences, bad array accesses, memory leaks, and uninitialized variables.
3] CRYSTAL(TM) 3D integrated reservoir characterization solution, which includes approximately 1 million lines of C++ code, is now 'Coverity Clean' - all critical, Coverity platform-found defects such as buffer overflows and null pointer dereferences have been found and fixed.
To date, they have fixed more than 2,100 high- and medium-impact defects, including null pointer dereferences, resource leaks and memory corruptions, and their defect density has dropped from 1.
Common defects found in open source code continue to be flaws such as memory corruptions, NULL pointer dereferences, and resource leaks, which can cause system crashes and security vulnerabilities in products.