...
No other identifiers are reserved. (Note that the The POSIX standard extends the set of identifiers reserved by the C Standard to include an open-ended set of its own. See Portable Operating System Interface [POSIX®], Base Specifications, Issue 7, Section 2.2, "The Compilation Environment" [IEEE Std 1003.1-2013].) The behavior of a program that declares or defines an identifier in a context in which it is reserved or that defines a reserved identifier as a macro name is undefined. (see See undefined behavior 106.).
Noncompliant Code Example (Header Guard)
...
In this noncompliant code example, because the C standard library header <inttypes.h>
is specified to include <stdint.h>
, the name SIZE_MAX
conflicts with a standard macro of the same name, which is used to denote the upper limit of size_t
. In addition, although the name INTFAST16_LIMIT_MAX
is not defined by the C standard library, it is a reserved identifier because it begins with the INT
prefix and ends with the _MAX
suffix. (see See the C Standard, 7.31.10.).
Code Block | ||||
---|---|---|---|---|
| ||||
#include <inttypes.h> #include <stdio.h> static const int_fast16_t INTFAST16_LIMIT_MAX = 12000; void print_fast16(int_fast16_t val) { enum { SIZE_MAX = 80 }; char buf[SIZE_MAX]; if (INTFAST16_LIMIT_MAX < val) { sprintf(buf, "The value is too large"); } else { snprintf(buf, SIZE_MAX, "The value is %" PRIdFAST16, val); } } |
...
According to the C Standard, 7.5, paragraph 2 [ISO/IEC 9899:2011], the behavior of a program is undefined when
a macro A macro definition of
errno
is suppressed in order to access an actual object, or the program defines an identifier with the nameerrno
.
...