"log_oom()" for then printing a short message, but not in "library" code.
- Do not issue NSS requests (that includes user name and host name
"log_oom()" for then printing a short message, but not in "library" code.
- Do not issue NSS requests (that includes user name and host name
- since they possibly result in truncated strings. Often it is nicer
- to use dynamic memory, alloca() or VLAs. If you do allocate fixed
- size strings on the stack, then it's probably only OK if you either
+ since they possibly result in truncated strings. It is often nicer
+ to use dynamic memory, alloca() or VLAs. If you do allocate fixed-size
+ strings on the stack, then it is probably only OK if you either
use a maximum size such as LINE_MAX, or count in detail the maximum
size a string can have. (DECIMAL_STR_MAX and DECIMAL_STR_WIDTH
macros are your friends for this!)
use a maximum size such as LINE_MAX, or count in detail the maximum
size a string can have. (DECIMAL_STR_MAX and DECIMAL_STR_WIDTH
macros are your friends for this!)
- Unless you allocate an array, "double" is always the better choice
than "float". Processors speak "double" natively anyway, so this is
- Unless you allocate an array, "double" is always the better choice
than "float". Processors speak "double" natively anyway, so this is
longs, long longs, all in unsigned+signed fashion, and the fixed
size types uint32_t and so on, as well as size_t, but nothing else.
longs, long longs, all in unsigned+signed fashion, and the fixed
size types uint32_t and so on, as well as size_t, but nothing else.
users then for ourselves! Note that assert() and assert_return()
really only should be used for detecting programming errors, not for
runtime errors. assert() and assert_return() by usage of _likely_()
users then for ourselves! Note that assert() and assert_return()
really only should be used for detecting programming errors, not for
runtime errors. assert() and assert_return() by usage of _likely_()
caching for any thread that is not the main thread. Use
is_main_thread() to detect whether the calling thread is the main
thread.
caching for any thread that is not the main thread. Use
is_main_thread() to detect whether the calling thread is the main
thread.