- Don't synchronously talk to any other service from PID 1, due to
risk of deadlocks
-- Avoid fixed sized string buffers, unless you really know the maximum
+- Avoid fixed-size string buffers, unless you really know the maximum
size and that maximum size is small. They are a source of errors,
- 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's 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!)
- Unless you allocate an array, "double" is always the better choice
than "float". Processors speak "double" natively anyway, so this is
- no speed benefit, and on calls like printf() "float"s get upgraded
+ no speed benefit, and on calls like printf() "float"s get promoted
to "double"s anyway, so there is no point.
- Don't invoke functions when you allocate variables on the stack. Wrong: