liveBook · Manning

Function decay

As explained in Modern C, Third Edition

Function decay is the C conversion in which an expression designating a function is converted to a pointer to that function in applicable contexts.

In C, a function name used without following parentheses converts to a pointer to that function. Thus f(3) performs decay before calling, while (&f)(3) calls through its address. section 11.4

TAKEAWAY rules:

  • Treat function declarations and function-pointer declarations as closely related; typedefs can make callback types readable. section 11.4
  • Pass decayed function pointers to callback-based interfaces such as atexit, bsearch, and qsort. section 11.4

How Modern C, Third Edition covers it

How deep it goes
Explains conversion rules, equivalent call forms, declarations, callbacks, and comparison safety, stopping short of broader pointer internals.
Examples
Demonstrates equivalent calls, atexit declarations, qsort callbacks, safe unsigned comparison, and overflow-prone integer comparison.
What it assumes
Assumes basic C functions and pointers while establishing function-pointer syntax and decay behavior explicitly.
What you can do after
Apply it via function-pointer callbacks and distinguish safe comparison implementations from overflow-prone ones.
How it connects
Connects function decay with function pointers, array decay, function parameters, callbacks, bsearch, and qsort.

Also explained in

Compare how 2 books explain function decay →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C, Third Edition. The section links point to the parts of the book it draws on.