liveBook · Manning

Effective type

An effective type is the C type through which an object may be accessed under the language’s object-access rules.

How 2 Manning books explain it

Modern C, Third Edition

An effective type is the type that C associates with storage allocated without a declared type through the accesses or stores that establish how the storage may be used.

How it is used
Constrains pointer-based access to objects in C's memory model and supports aliasing assumptions.
How deep it goes
Defines declared, allocated, character, and union cases, then stops short of detailed alias-analysis mechanics.
Examples
Uses malloc-backed double storage, unsigned-char inspection, and an incompatible unsigned-pointer dereference.
What you can do after
Apply effective-type rules to allocated storage and diagnose incompatible pointer accesses as undefined behavior.

Read how Modern C, Third Edition explains effective type →

Modern C

An effective type is the C type through which an object is permitted to be accessed under the language's object-access rules.

How it is used
Constrains pointer-based object access and supplies the basis for the aliasing rule.
How deep it goes
Defines declared, union, character, and allocated-storage cases, but defers the latter's detailed treatment.
Examples
Uses an unsigned-char array cast to unsigned* and allocated storage initialized through assignment.
What you can do after
Evaluate pointer-based accesses for effective-type violations and recognize when dereferencing leaves program state undefined.

Read how Modern C explains effective type →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.