...
These cases are recorded in the list of undefined behavior, items 104, 108, 116, 118, and 130.
Programmers should never attempt to access anything underlying any of these macros.
...
Code Block | ||
---|---|---|
| ||
#include <myassert.h> #include <assert.h> void fullAssert(int e) { assert(0 < e); // standard library assert() myassert(e); // well defined custom assertion function } |
Noncompliant Code Example (
...
Redefining errno
)
Legacy code is apt to include an incorrect declaration such as the following.
Code Block | ||
---|---|---|
| ||
extern int errno; |
Compliant Solution (
...
Redefining errno
)
The correct way to declare errno
is to include the header <errno.h>
.
...