This commit is contained in:
Miloslav Ciz 2023-03-11 21:27:00 +01:00
parent 1d031b7d3a
commit 7f05aeef53
7 changed files with 27 additions and 13 deletions

View file

@ -38,6 +38,8 @@ int main(void)
**Char data type signedness is not defined**. The signedness can be explicitly "forced" by specifying `signed char` or `unsigned char`.
**[Floating point](float.md) results are not completely defined**, no representation (such as IEEE 754) is defined and there may appear small differences in floating operations under different machines or e.g. compiler optimization settings -- this may lead to [nondeterminism](determinism.md).
## Memory Unsafety
Besides being extra careful about writing memory safe code, one needs to also know that **some functions of the standard library are memory unsafe**. This is regarding mainly string functions such as `strcpy` or `strlen` which do not check the string boundaries (i.e. they rely on not being passed a string that's not zero terminated and so can potentially touch memory anywhere beyond); safer alternatives are available, they have an `n` added in the name (`strncpy`, `strnlen`, ...) and allow specifying a length limit.