Error handling
From cppreference.com
< c
C
Error handling
Concurrency support (C11)
Error handling
Error codes
Assertions
(C11)(removed in C23)
Bounds checking
(C11)
(C11)
(C11)
[edit] Error numbers
Defined in header
<errno.h>
[edit] Assertions
Defined in header
<assert.h>
aborts the program if the user-specified condition is not true. May be disabled for release builds
(function macro) [edit]
(function macro) [edit]
(C11)(removed in C23)
(keyword macro)
Bounds checking
The standard library provides bounds-checked versions of some existing functions (gets_s , fopen_s , printf_s , strcpy_s , wcscpy_s , mbstowcs_s , qsort_s , getenv_s , etc). This functionality is optional and is only available if __STDC_LIB_EXT1__ is defined. The following macros and functions support this functionality.
Defined in header
<errno.h>
Defined in header
<stdio.h>
errno_t
(C11)
(typedef)
Defined in header
<stddef.h>
Defined in header
<stdio.h>
Defined in header
<stdlib.h>
Defined in header
<string.h>
Defined in header
<time.h>
Defined in header
<wchar.h>
rsize_t
(C11)
(typedef)
Defined in header
<stdint.h>
RSIZE_MAX
(C11)
(macro variable)
Defined in header
<stdlib.h>
Note: implementations of bounds-checked functions are available as open-source libraries Safe C and Slibc, and as part of Watcom C. There is also an incompatible set of bounds-checked functions available in Visual Studio.
(since C11)[edit] Notes
Since C23, static_assert is itself a keyword, which may also be a predefined macro, so <assert.h>
no longer provides it.
[edit] References
Extended content |
---|
|
[edit] See also
(C99)(C99)(C99)
(macro constant) [edit]
C++ documentation for Error handling