A reserved identifier is a name whose meaning is fixed by the C standard or reserved for library, implementation, or future language use. Programs must not redefine such names in their own declarations. section 9.2
A reserved suffix
The optional Annex K bounds-checking interfaces use names such as printf_s. Because identifiers ending in _s are reserved for these interfaces, application code should not create its own functions or declarations with that suffix. section 8.1.4
Common reservation rules include:
- Names beginning with an underscore followed by another underscore or a capital letter are reserved for language extensions and internal use. section 9.2
- Names beginning with an underscore are reserved for file-scope identifiers and for enumeration, structure, and union tags. section 9.2
- Predefined names, including C library functions, identifiers beginning with str or E, and identifiers ending in _t, are reserved in the contexts specified by the standard. section 9.2
- Keep header-visible identifiers conforming, expose only intended API names, and use unlikely naming prefixes for reusable libraries. section 9.2
#if !__STDC_LIB_EXT1__ # error "This code needs bounds checking interface Annex K" #endif #define __STDC_WANT_LIB_EXT1__ 1 #include <stdio.h> /* Use printf_s from here on. */
This listing shows the feature-test macros required before headers when using the optional Annex K interface, followed by a reserved-suffix function. section 8.1.4
