A namespace collision occurs when names declared by application code, libraries, implementations, or macros interfere unexpectedly. C makes these conflicts especially troublesome because reserved identifiers may remain harmless until a new standard, compiler, client machine, or system upgrade changes the surrounding environment. section 9.2
Reduce collision risk by applying explicit naming rules:
- Expose only types and functions intended as the public API; avoid polluting the global identifier space. section 9.2
- Avoid reserved identifiers, including many C-library names, names beginning with str or E, and names ending in _t. section 9.2
- Use distinctive prefixes for library interfaces and internals, and remember that macros can collide with structure members and function parameters. section 9.2
Prefix public and internal names
A generic interface such as memory_sum(size_t N, size_t I, double strip[N][I]) exposes short names. A prefixed form—p99_memory_sum(size_t p00_n, size_t p00_i, double p00_strip[p00_n][p00_i])—separates the public API from implementation-oriented names and reduces accidental collisions.


